I am trying to add a css class to nodes into the Ext.view.View. I use this to list N divs inside the View and make them selectable. When selected one of these divs it should change the color to identify that it’s selected.
Ext.create('Ext.view.View', {
store: ...
tpl: ...
multiSelect: true,
height: 310,
trackOver: true,
overItemCls: 'cell-wrap-hover',
itemSelector: 'div.cell-wrap',
emptyText: 'No item to show',
plugins: [
Ext.create('Ext.ux.DataView.DragSelector', {})
],
listeners: {
selectionchange: function(dv, nodes){
if (nodes.length > 0) {
for (var i in nodes) {
//Here i would like to add one more css class to the nodes[0]
}
}
}
}
Once i add this new class, and keep the others, i can use the new class name as Selector, for selected items in View, also make them look different.
I find the answer by myself: In tpl i add one ID for the DIV selector, like: id=”cell-X”, where X is one index (0,1,2…).
Then into the foreach i use the command line to add the class on selected nodes:
Thanx