2 * Ext JS Library 2.2.1
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
11 App.EmployeeGrid = Ext.extend(Ext.grid.GridPanel, {
\r
12 initComponent: function() {
\r
14 {dataIndex: 'lastName', header: 'Name', renderer: this.renderName},
\r
15 {dataIndex: 'department', header: 'Department'},
\r
16 {dataIndex: 'title', header: 'Title'},
\r
17 {dataIndex: 'telephone', header: 'Telephone'},
\r
18 {dataIndex: 'office', header: 'Office'}
\r
23 App.EmployeeGrid.superclass.initComponent.call(this);
\r
24 this.getSelectionModel().on('rowselect', this.onRowSelect, this, {buffer: 300});
\r
27 renderName: function(val, md, record) {
\r
28 return String.format('{0}, {1}', val, record.get('firstName'));
\r
30 onRowSelect: function(sm, idx, r) {
\r
31 Ext.getCmp('employeeDetails').load(r.id);
\r
34 Ext.reg('employeegrid', App.EmployeeGrid);
\r