日期:2014-05-16  浏览次数:20360 次

ExtJS grid简单应用
var grid = new Ext.grid.GridPanel({
				listeners:{
					"rowcontextmenu":function(){
						alert(1);
					}
				},
                store: new Ext.data.JsonStore({
                    fields: [{name:'name1111',mapping:"name"},{name:'id1111',mapping:"id"}],      //头,数据
                    root: 'rows',
                    totalProperty: 'results',
                    data:{'results':2,'rows':[
        					{'id':1,'name':'Bill'},
       						{'id':2,'name':'Ben'}
        				]}
                }),
                columns: [
                    {header:'序号',dataIndex:'id1111'}, //给头赋值
                    {header:'名称',dataIndex:'name1111'} 
                ]
            });