extjs Combox 調用數據

1方法一 從 json獲取

var typeStore = new Ext.data.Store({
                proxy : new Ext.data.HttpProxy({url : ctx + '/cms/faqTypeListCombox.do'}),
                reader : new Ext.data.JsonReader({}, [ 'value', 'name' ]) // 顯示的字段名,與服務器端返回的json中字段一致
            
            });
new Ext.Panel({
				columnWidth : .2,
				layout : 'form',
				border : false,
				labelWidth : 58,
				labelAlign : 'right',
				items : [ {
					xtype : 'combo',
					fieldLabel : '所屬分類',
					hiddenName : 'typeId',
					store : typeStore,
					emptyText : '請選所屬分類',
					triggerAction : 'all',
					valueField : 'value',
					displayField : 'name',
					readonly : true,
					allowBlank : true,
					editable : false,
					// anchor:'20%'
					width : 130
				} ]
			})


發佈了16 篇原創文章 · 獲贊 26 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章