HI I have a DataView with XTemplate.
In my controller, I listen to the itemclick
event.
onItemClick: function(view, record, item) {
var me = this,
panel = me.getRightPanel();
// here I need to know if the item clicked is already selected
}
Is there a way to know if the item clicked is already selected?
You could call getSelectionModel
on your DataView
object and then call getSelection
on the result. This would give you an array of Model
objects. After that, just check if object record
(the parameter to onItemClick
) is in the array.