ExtJs常用数据源store
1 SimpleStore
store: new Ext.data.SimpleStore({
?? ??? ??? ?fields: ['num', 'name'],
?? ??? ??? ?data : [[1,'年報(bào)表'],[2,'月報(bào)表'],[3,'日?qǐng)?bào)表']]
?? ??? ?}),
2 Store
?
??? var lectordata=new Ext.data.Store({///列表框中的選項(xiàng)數(shù)據(jù)
???? ? proxy: new Ext.data.HttpProxy({url:"user.do?method=getRole"}),//獲取json數(shù)據(jù)得地址
????? ?reader: new Ext.data.JsonReader({},["id","name"])
?? });
3 JsonStore
?
store: new Ext.data.JsonStore({
??????????? url:"user.do?method=getUser",
????????????fields: [id, 'name']
????????}),
?
?
?
比如下?? var lectordata=new Ext.data.Store({///列表框中的選項(xiàng)數(shù)據(jù)
???? ? proxy: new Ext.data.HttpProxy({url:"user.do?method=getRole"}),//獲取json數(shù)據(jù)得地址
????? ?reader: new Ext.data.JsonReader({},["id","name"])
?? });
?
拉框 獲取值 可以這樣寫
?
{
????xtype:"combo",emptyText:"---角色---",fieldLabel:"userRole",width:"70%",
????? store:lectordata,
?????? valueField:"id",
?????? displayField:"name",
?????? mode: 'remote',
?????? triggerAction: 'all',
?????????????? ?selectOnFocus:true //用戶不能自己輸入,只能選擇列表中有的記錄
}
轉(zhuǎn)載于:https://www.cnblogs.com/liaomin416100569/archive/2010/01/25/9331976.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的ExtJs常用数据源store的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: VS插件的开发 - Visual Stu
- 下一篇: 《WinForm开发系列之控件篇》Ite