ExtJS grid簡單應用
阿新 • • 發佈:2018-12-25
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'}
]
});