古詩詞大全網 - 古詩大全 - ext中model 和store 和listener的關系

ext中model 和store 和listener的關系

model表示要顯示的列模型

store表示數據源

listener表示監聽

給妳個示例:

new Ext.data.Store({

proxy:new Ext.data.HttpProxy({

url:'archiveUsingRegister.html?method=listUsingStore'

}),

id: 'usingStoreStore' ,

usingStoreFields: [{name: 'id'},{name: 'username'}] ,

usingStoreColumnModel: new Ext.grid.ColumnModel( [ new Ext.grid.CheckboxSelectionModel(),{header: '',dataIndex: 'id',hidden:true},{header: '姓名',dataIndex: 'username',hidden:false} ] ) ,

reader:new Ext.data.JsonReader({

totalProperty: 'totalCount',root:'usingStores'},[{name: 'id'},{name: 'username'}]),

listeners: {update: function(s,r){") ;

saveUsingStoreSingle(s,r) ;") ;

}}});