我可以使用字段名“projectID”加载我的第一个组合框。
当我选择组合框值时,我想填充axcode字段。 我知道我的网址有效,检索到的数据是:
[{ “ID”: “26”, “组ID”: “1”, “专案编号”: “18”, “描述”: “假日”, “isActive”: “1”},{ “ID” : “28”, “组ID”: “1”, “专案编号”: “18”, “描述”: “其他”, “isActive”: “1”},{ “ID”: “24”, “组ID” :“1”,“projectID”:“18”,“描述”:“病假”,“isActive”:“1”},{“id”:“27”,“groupID”:“1”,“projectID “:”18“,”描述“:”无薪假“,”isActive“:”1“},{”id“:”25“,”groupID“:”1“,”projectID“:”18“,”描述 “:” 假期”, “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
答案 0 :(得分:0)
你可以尝试这样做
<select class="easyui-combobox " data-options="
required:true,
valueField:'family_id',
textField:'family',
url:'<?php echo site_url(); ?>/ref_json/DataFamily',
onSelect: function(rec){
var url = '<?php echo site_url(); ?>/ref_json/DataMaterial1/'+rec.family_id;
$('#material').combobox('reload',url);
}" id="family" name="family" style="width:120px;">
</select>