2017-06-04 11 views
1

最初のddlから値を変更すると、他のddlのAjaxからデータが取得されますが、それは更新されません。 別のドロップダウンリストのイベント変更後のKendoドロップダウンリストを更新

この

は、これが最初のDDL

function vsDropDownEditor(container, options) { 
    $('<input id="ddlVs" data-bind="value:' + options.field + '"/>') 
       .appendTo(container) 
       .kendoDropDownList({ 
        dataTextField: "ValueStream", 
        dataValueField: "Id", 
        dataSource: categories, 
        select: onSelect 
       }); 
} 

の編集者からの方法そして第二に、DDLの編集者から、この他の方法であり、私のグリッド

$("#grid").kendoGrid({ 
     dataSource: 
height: 500, 
       toolbar: ["create"], 
       columns: [ 
        { command: ["edit"], title: "&nbsp;", width: "150px", locked: true }, 
        { field: "RowLabels", title: "Row Labels", width: "180px", locked: true }, 
        { field: "IdValueStream", title: "VS", width: "90px", locked: true, editor: vsDropDownEditor, template: "#=getVsName(IdValueStream)#" }, //, template: "#=IdValueStream.ValueStream#" 
        { field: "IdLine", title: "Line", width: "180px", locked: true, editor: linesDropDownEditor }, //, template: "#=getLineName(IdLine)#" 
         { field: "W1", title: Weeks[0].W1.substring(0, 10), width: "98px" }, // 
         { field: "W2", title: Weeks[0].W2.substring(0, 10), width: "90px" }, 
         { field: "W3", title: Weeks[0].W3.substring(0, 10), width: "90px" }, 
         { field: "W4", title: Weeks[0].W4.substring(0, 10), width: "90px" }, 
         { field: "W5", title: Weeks[0].W5.substring(0, 10), width: "90px" }, 
         { field: "W6", title: Weeks[0].W6.substring(0, 10), width: "90px" }, 
         { field: "W7", title: Weeks[0].W7.substring(0, 10), width: "90px" }, 
         { field: "W8", title: Weeks[0].W8.substring(0, 10), width: "90px" }, 
         { field: "W9", title: Weeks[0].W9.substring(0, 10), width: "90px" }, 
         { field: "W10", title: Weeks[0].W10.substring(0, 10), width: "90px" }, 
         { field: "W11", title: Weeks[0].W11.substring(0, 10), width: "90px" }, 
         { field: "W12", title: Weeks[0].W12.substring(0, 10), width: "90px" }, 
         { field: "W13", title: Weeks[0].W13.substring(0, 10), width: "90px" } 
       ], 
       editable: "inline" 
      }); 

ある

function linesDropDownEditor(container, options) { 

    $('<input data-bind="value:' + options.field + '"/>') 
       .appendTo(container) 
       .kendoDropDownList({ 
        autoBind: false, 
        dataTextField: "Line", 
        dataValueField: "Id", 
        dataSource: lines 
       }); 
} 

したがって、最初のddlの項目を選択すると、2番目のddlを更新したい

答えて

0

2番目のドロップダウンにid属性を設定し、onSelectの機能にddVsという文字列を追加できます。

$("#nameOfYourSecondDropdownHere").data('kendoDropDownList').dataSource.read();

+0

私がドロップダウンにIDを置くことができますどのように?グリッド内に自動的に作成されるためです –

+1

DDLが初期化される要素に置きます。例: function linesDropDownEditor(container、options){ $( ' ') .appendTo(container) .kendoDropDownList({ autoBind:false、... – topalkata

0

また、次の例をチェックアウトすることができます - グリッド内のエディタとして使用DropDownListsをカスケード:

Add Cascading DropDownList Editors

+0

カスケードから同じIDを持つそれら –

関連する問題