extjs Combox 调用数据
2015-08-20 10:47
447 查看
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
} ]
})
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
} ]
})
相关文章推荐
- js -- 捆绑
- JavaScript的一些技巧
- 学习javascript设计模式之单例模式
- JSTL核心标签库
- 张孝祥JavaScript视频下载地址。
- C# JSON字符串序列化与反序列化(转)
- Phantomjs 进程通信方式
- JS函数式编程【译】4.2 函数组合
- 开启JS学习之路
- JS中将日期字符串转换为日期型过程中出现的问题
- JavaScript 自动分页插件 datatables
- javascript -- 事件捕获,事件冒泡
- 关于placeholder.js在IE78密码文本的提示文字调整
- js代码实现无缝滚动(文字和图片)
- js图片翻书效果代码分享
- JS给Textarea文本框添加行号的方法
- json与jsonp的区别
- js Unicode编码相互转换
- js实现Select列表内容自动滚动效果代码
- js Unicode编码相互转换