[code="js"]
var profileListStore = new Ext.data.JsonStore({
url : 'userprofile.do?method=getUserProfileList',
root : 'profileList',
autoLoad : true,
fields : ['profileID', 'profileName', 'profileShare']
});
//----------------store-----------------------//
var profileList = new Ext.form.ComboBox({
id : 'ef_comprofileList',
editable : false,
store : profileListStore,
labelSeparator : '',
fieldLabel : 'Profile List',
hiddenName:'testhidden',
mode : 'local',
// hiddenName :'profileID',
triggerAction : 'all',
tpl : new Ext.XTemplate(
''
+ ''
+ '
});
profileListStore.on('load', function(store, records, options) {
// var a=records.length;
// for(var i=0;i<records.length;i++){
// if(records[i].json.profileShare=='Public'){
// records[i].set('[Pub]'+records[i].data.profileName)
// }else if(records[i].json.profileShare=='Private'){
// records[i].set('[Pri]'+records[i].data.profileName)
// }
// }
this.insert(0, myNewRecord);
profileList.setValue('0');
// console.log(myNewRecord,alarmCategoryStore.getCount())
});
[/code]
store的数据:{"success":"true","profileList":[{"profileID":"1","profileShare":"Public","profileName":"Default"}]}
提交到后台时,就老是把'profileName'的值提交上去,而不是'profileID'的值,,用hiddenName:'testhidden',了,不知道是不是自己大意了,还是能把是'profileID'的值发到后台
请解答下
谢谢
id/name传的是displayField
hiddenName传的是valueField -- 实际上就是生成一个hidden类型的input
你用firebug看下对应的这个input的值是什么
另外,可以先把tpl等干扰因素去掉先
解决了?