首頁  >  文章  >  web前端  >  Ext中下拉清單ComboBox元件store資料格式用法介紹_extjs

Ext中下拉清單ComboBox元件store資料格式用法介紹_extjs

WBOY
WBOY原創
2016-05-16 17:28:501666瀏覽
複製程式碼 程式碼如下:

var p_years = new Ext.form.ComBox(>
var p_years = new Ext.form.ComBox( : '統計年份',
anchor : anchor_w,
mode : 'remote',
maxHeight:100,
triggerAction : 'all',
selectOnFocus : force, editable : false,
//store :[['11', '2011'], ['12', '2012'],['13', '2013']] //此為第一種
store:[2011,2012,2013,2014,2015,2016,2017,2018] //此為第二種,當沒有製定value和text的時候,預設提交值與顯示值為同一個。是前者,後者作為顯示值。
以下是比較正規用法,從資料庫同步資料字典渲染comboBox元件



複製程式碼
程式碼如下: 程式碼如下:

程式碼如下:



程式碼如下:


var proj_main_store = new Ext.data.JsonStore({
url : "************",
fields : ['TEXT', 'VALUE'] ,
root : "objs",
baseParams : {
"obj/dicttypeid" : "BM_IMPORTANT_PROJ"
}
});
proList_main_store🎜>}
});
proList_main_store. (){
proj_main_store.insert(0, new Ext.data.Record({
'TEXT' : '全部',
'VALUE' : ""
}));
});
var proj_main_type = new Ext.form.ComboBox( {
fieldLabel : '重點工程',
anchor : anchor_w,
mode : 'remote',
trigger : 'all ', selectOnFocus : true, forceSelection : true, editable : false, valueField : 'VALUE', displayField : 'TEXT',
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn