我可以使用字段名称“projectID”加载我的第一个组合框。
当我选择一个组合框值时,我想填充 axcode 字段。我知道我的网址有效,并且检索到的数据是:
[{"id":"26","groupID":"1","projectID":"18","Description":"Holiday","isActive":"1"},{"id":"28 ","groupID":"1","projectID":"18","Description":"Other","isActive":"1"},{"id":"24","groupID":"1 ","projectID":"18","Description":"病假","isActive":"1"},{"id":"27","groupID":"1","projectID":" 18","Description":"无薪休假","isActive":"1"},{"id":"25","groupID":"1","projectID":"18","Description":"假期","isActive":"1"}]
有人能告诉我为什么这段代码不起作用吗?
{field:'projectID',
title:'Project/Paid Leave',
width:100,
editor:{
type:'combobox',
options:{
valueField:'id',
textField:'DescriptionCode',
data:cmbprojects,
required:true,
editable:false,
onSelect:function(record){
$('#axCode').combobox('reload','remote_combo_data.php?type=projectax&projectID='+record.id);
}
// closes onSelect
}
// closes options
}
// closes editor
}
// closes field
,
{
field:'axCode',
title:'axCode',
width:100,
editor:{
type:'combobox',
valueField:'id',
textField:'Description',
data:cmbaxcodes,
required:true,
editable:false
}
// closes editor
,formatter:function(value,row,index){return row.Description;}
// closes formatter
}
// closes field
,
{
field:'activityID',
title:'Activity',
width:100,
editor:{
type:'combobox',
options:{
// this is a key/value pair from the data source
valueField:'id',
textField:'ActivityCode',
data:cmbactivities,
required:true,
editable:false
}
// closes options
}
// closes editor
,formatter:function(value,row,index){return row.ActivityCode;}
}
//closes field