O'Reilly logo

Learning Ext JS 4 by Armando Gonzalez, Crysfel Villa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling events on the dataview

Once we have our dataview defined, we are going to see some basic events handling for it. To do that, we need to add some new properties in our view definition.

/**
 * @classApp.view.UsersView
 * @extendsExt.view.View
 * This the definition of our users data view
 */
Ext.define('App.view.UsersView', {
  extend: 'Ext.view.View',
  xtype:'usersview',
  store:'Users',
    emptyText:'No users available',
    itemSelector: 'div.selector', //step one
    tpl:[
      '<tpl for=".">',
        '<div class ="selector">', //step two
        '{firstName} {lastName}',
      '</div>',
    '</tpl>'].join('')
});
  • In the previous code, we have added two important lines of code that are required to interact with our dataview.
  • In step one, we have the itemSelector property that defines ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required