July 2015
Beginner
452 pages
8h 34m
English
Once we have our DataView defined, we are going to see some basic event handling for it. To do this, we need to add some new properties to our view definition so that we can assign events:
var myDataview = Ext.create('Ext.view.View', {
store: myStore,
tpl: myTpl,
padding: 6,
itemSelector: 'div.user', //Step 1
emptyText: '<b>No users available</b>'
});We added the itemSelector property (Step 1). It defines which DOM node item will be used to select each item (data model) with which the DataView will be working.
You can use CSS selectors to define the itemSelector property.
And now, let's add the event listener:
var myDataview = Ext.create('Ext.view.View', { store: myStore, tpl: myTpl, padding: 6, itemSelector: 'div.user', ...Read now
Unlock full access