Extjs is an object-oriented feature used in the UI Layer of the J2EE framework, which is often attributed to the interface presentation layer.
In fact, extjs Ext. Grid. gridpanel is also an MVC Framework, which consists of four necessary components:
Store: The model holding the data records (rows) New Ext. Data. Store
Column Model: Column makeup new Ext. Grid. columnmodel
View: Encapsulates the user interface viewconfig
Selection Model: Selection behavior new Ext. Grid. rowselectionmodel
var grid = new Ext.grid.GridPanel({ store: new Ext.data.Store({ autoDestroy: true, reader: reader, data: xg.dummyData }), colModel: new Ext.grid.ColumnModel({ defaults: { width: 120, sortable: true }, columns: [ {id: 'company', header: 'Company', width: 200, sortable: true, dataIndex: 'company'}, {header: 'Price', renderer: Ext.util.Format.usMoney, dataIndex: 'price'}, {header: 'Change', dataIndex: 'change'}, {header: '% Change', dataIndex: 'pctChange'}, // instead of specifying renderer: Ext.util.Format.dateRenderer('m/d/Y') use xtype { header: 'Last Updated', width: 135, dataIndex: 'lastChange', xtype: 'datecolumn', format: 'M d, Y' } ] }), viewConfig: { forceFit: true, //Return CSS class to apply to rows depending upon data values getRowClass: function(record, index) { var c = record.get('change'); if (c < 0) { return 'price-fall'; } else if (c > 0) { return 'price-rise'; } } }, sm: new Ext.grid.RowSelectionModel({singleSelect:true}), width: 600, height: 300, frame: true, title: 'Framed with Row Selection and Horizontal Scrolling', iconCls: 'icon-grid'});
Http://hi.baidu.com/jsjok/blog/item/8f12611b3b0d685f42a9ad4b.html