source: trunk/web/addons/job_monarch/lib/extjs/examples/remoteload/EmployeeGrid.js @ 619

Last change on this file since 619 was 619, checked in by ramonb, 15 years ago

lib/:

  • added new AJAX dependancies: ExtJS, pChart, Lightbox2
File size: 991 bytes
Line 
1/*
2 * Ext JS Library 2.2.1
3 * Copyright(c) 2006-2009, Ext JS, LLC.
4 * licensing@extjs.com
5 *
6 * http://extjs.com/license
7 */
8
9Ext.ns('App');
10
11App.EmployeeGrid = Ext.extend(Ext.grid.GridPanel, {
12        initComponent: function() {
13                this.columns = [
14                        {dataIndex: 'lastName', header: 'Name', renderer: this.renderName},
15                        {dataIndex: 'department', header: 'Department'},
16                        {dataIndex: 'title', header: 'Title'},
17                        {dataIndex: 'telephone', header: 'Telephone'},
18                        {dataIndex: 'office', header: 'Office'}
19                ];
20                this.viewConfig = {
21                        forceFit: true
22                };
23                App.EmployeeGrid.superclass.initComponent.call(this);
24                this.getSelectionModel().on('rowselect', this.onRowSelect, this, {buffer: 300});
25                this.store.load();
26        },
27        renderName: function(val, md, record) {
28                return String.format('{0}, {1}', val, record.get('firstName'));
29        },
30        onRowSelect: function(sm, idx, r) {
31                Ext.getCmp('employeeDetails').load(r.id);
32        }
33});
34Ext.reg('employeegrid', App.EmployeeGrid);
Note: See TracBrowser for help on using the repository browser.