I want to implement this example of celllist with one modification. I want to make each row to a grey color once its clicked by someone. It should persist there, and not change as the user clicks on another row. It's okay if its gone once a new server call is made. I'm doing this to mark it as a 'read message' for the user. Any clues?
I overrided (updated) the css style of cellList as below but when I inspect I dont see the 'myCss' style being applied .
CellListStyles.css
@external .dataView-cellListWidget;
@external .dataView-cellListEvenItem;
@external .dataView-cellListOddItem;
@external .dataView-cellListKeyboardSelectedItem;
@external .dataView-cellListSelectedItem;
.dataView-cellListWidget{}
.dataView-cellListEvenItem{}
.dataView-cellListOddItem{}
.dataView-cellListKeyboardSelectedItem{}
.dataView-cellListSelectedItem{}
.dataView-cellListWidget {
}
@external .dataView-cellListEvenItem .myCss{
background-color: aqua;
}
@external .dataView-cellListOddItem .myCss{
background-color: aqua;
}
.dataView-cellListEvenItem,.dataView-cellListOddItem {
cursor: pointer;
padding: 2px 5px;
zoom: 1;
}
@external .dataView-cellListKeyboardSelectedItem .myCss{
background-color: red;
}
.dataView-cellListKeyboardSelectedItem {
background: #ffc;
}
.dataView-cellListSelectedItem {
background-color: #FFCBC1;
color: #121212;
height: auto;
overflow: visible;
}
One way to do it will be add a class to the selected object and apply css. you might have to override cellList resource css. to override cellList resource css have a look here.
A tried my own suggestion and it works. you need to override the resource.
Some sample code.
Apply resources to celllist :
i have created 2 interfaces in 2 separate classes
use this in sortListStyle.css
declare above css in your application css files P.S. added 2 new classes for showing visited
Render a hidden field to indicate selected
Selection Model :