2013-08-24 25 views
0

我能夠加載我的第一個組合框與字段名稱「projectID」。這個jEasyUI組合框爲什麼不更新?

當我選擇一個組合框值時,我想填充axcode字段。 我知道我的網址有效,並且檢索到的數據是:

[{「id」:「26」,「groupID」:「1」,「projectID」:「18」,「Description」: 「假日」, 「isActive」: 「1」},{ 「ID」: 「28」, 「組ID」: 「1」, 「專案編號」: 「18」, 「描述」: 「其他」, 「isActive」: 「1」},{「id」:「24」,「groupID」:「1」,「projectID」:「18」,「描述」:「病假」,「isActive」:「1」},{「 ID「:」27「,」groupID「:」1「,」projectID「:」18「,」描述「:」無薪假期「,」isActive「:」1「},{」id「:」25「, 「groupID」:「1」,「projectID」:「18」,「Description」:「Vacation」,「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

你可以嘗試做這樣的

<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>