代码如下 跪求高人指点
Ext.onReady(function () {
contextPath='/base';
//定义C 类别数据源
var sto_categoryName = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url : contextPath
+ "/auto/tblDictionaryAction_queryDictItem.action",
method: "GET"
}),
reader: new Ext.data.JsonReader({
fields: ["dictCode", "dictName"],
root: 'result',
})
});
/*sto_categoryName.load();
var a=new Ext.data.Store({
})*/
sto_categoryName.load()
sto_categoryName.on('load', function(store, record, options) {
if (record.length > 0) {
var data = { 'dictCode': '', 'dictName': '请选择' };
var rs = [new Ext.data.Record(data)];
store.insert(0, rs); //增加一个
}
});
var c_box=new Ext.form.ComboBox({
id: 'c_box',
width: 150,
fieldLabel: 'C 类别',
mode: 'local',
emptyText:'请选择',
editable: false,
displayField: 'dictName', //key
valueField: 'dictCode', //value
triggerAction: 'all',
store: sto_categoryName,
listeners: {
select: function(combo, record, index) {
Ext.getCmp('cbx_typeName').store.load({ //cbx_typeName: 二级
params: { dictType: 'ConfigItemType', dictParentCode: record.data.dictCode},
callback: function(records) {
Ext.getCmp("cbx_typeName").setValue(''); //重置T至(请选择)
Ext.getCmp("cbx_itemName").setValue(''); //重置I至(请选择)
}
});
}
}
})
var panel= new Ext.Panel({
title:'',
frame:false,
layout: 'table',
width:800,
height: 300,
layoutConfig:{columns:2},
items:[{
title:'配置项属性管理',
frame:true,
layout: 'table',
width:800,
height: 60,
colspan:2,
items: [{
frame:false,
layout: 'form',
width:265,
height: 60,
labelWidth: 40,
items:[c_box]
为什么动态数据显示不出来
Ext.onReady(function () {
contextPath='/base';
//定义C 类别数据源
var sto_categoryName = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url : contextPath
+ "/auto/tblDictionaryAction_queryDictItem.action",
method: "GET"
}),
reader: new Ext.data.JsonReader({
fields: ["dictCode", "dictName"],
root: 'result',
})
});
/*sto_categoryName.load();
var a=new Ext.data.Store({
})*/
sto_categoryName.load()
sto_categoryName.on('load', function(store, record, options) {
if (record.length > 0) {
var data = { 'dictCode': '', 'dictName': '请选择' };
var rs = [new Ext.data.Record(data)];
store.insert(0, rs); //增加一个
}
});
var c_box=new Ext.form.ComboBox({
id: 'c_box',
width: 150,
fieldLabel: 'C 类别',
mode: 'local',
emptyText:'请选择',
editable: false,
displayField: 'dictName', //key
valueField: 'dictCode', //value
triggerAction: 'all',
store: sto_categoryName,
listeners: {
select: function(combo, record, index) {
Ext.getCmp('cbx_typeName').store.load({ //cbx_typeName: 二级
params: { dictType: 'ConfigItemType', dictParentCode: record.data.dictCode},
callback: function(records) {
Ext.getCmp("cbx_typeName").setValue(''); //重置T至(请选择)
Ext.getCmp("cbx_itemName").setValue(''); //重置I至(请选择)
}
});
}
}
})
var panel= new Ext.Panel({
title:'',
frame:false,
layout: 'table',
width:800,
height: 300,
layoutConfig:{columns:2},
items:[{
title:'配置项属性管理',
frame:true,
layout: 'table',
width:800,
height: 60,
colspan:2,
items: [{
frame:false,
layout: 'form',
width:265,
height: 60,
labelWidth: 40,
items:[c_box]
为什么动态数据显示不出来