{
columnWidth : 0.5,
layout : 'form',
defaultType : 'textfield',
items : [{
xtype : "combo",
width : 125,
fieldLabel : '类别',
name : 'categoryId',
displayField : 'categoryName',
id : 'categoryCombotree',
valueField : 'categoryId',
hiddenName : 'categoryId',
store : new Ext.data.SimpleStore({
fields : [],
data : [[]]
}),
editable : false,// 是否可编辑的表格
selectClass : '',// 适用于所有样式
mode : 'local', // 本地数据
triggerAction : 'all', // 是否自动匹配
autoHeight : true,
tpl : "<tpl for='.'><div style='height:200px'><div id='typeTree'></div></div></tpl>", // 模板
allowBlank : false,
BlankText : '类型为必填项', // 循环
emptyText : '请选择类型' }]
}if (node.id != 0) {
formPanel.findById('categoryCombotree').value= node.id;// 设置combo的键值
formPanel.findById('categoryCombotree').setRawValue(node.text); // 给combo设置显示的值
formPanel.findById('categoryCombotree').collapse(); // 隐藏下拉列表中,如果它展开,这个属性将会完成数据的加载
formPanel.findById('categoryCombotree').hiddenField.value = node.id;
}
columnWidth : 0.5,
layout : 'form',
defaultType : 'textfield',
items : [{
xtype : "combo",
width : 125,
fieldLabel : '类别',
name : 'categoryId',
displayField : 'typeName',
id : 'categoryCombotree',
valueField : 'typeVal',
hiddenName : 'typeVal',
store : new Ext.data.SimpleStore({
autoLoad: true,
url: "后台数据url",
fields: ["typeName","typeVal"]
),
editable : false,// 是否可编辑的表格
selectClass : '',// 适用于所有样式
mode : 'remote', // 远程后台数据
triggerAction : 'all', // 是否自动匹配
autoHeight : true,
tpl : "<tpl for='.'><div style='height:200px'><div id='typeTree'></div></div></tpl>", // 模板
allowBlank : false,
BlankText : '类型为必填项', // 循环
emptyText : '请选择类型' }]
}
然后当我点击树的节点他就在下拉框中显示值并把id放下拉框里
当我保存页面时,后台获取他的id啊
后台获取id的方法是 String categoryId = request.getParameter("categoryId");
但是我想要获得的是id属性