如何为一列中的不同组合框设置不同的商店?

How to set different store for different comboboxes in one column?

我有到列的网格。在第二列中,我必须组合框(例如在第一行和第三行)。如何为他们设置不同的商店? 第二个组合框的值取决于第一个组合框

here is an image

我看到了一个例子,但有不同的列,而不是行

这还没有经过测试,但会给你一个想法。使用 cellediting 插件 "beforeedit" 事件处理程序获取 combo1 值并加载 combo2。

//在编辑 combo2 的事件处理程序之前。在触发 cellEditing 之前触发。

beforeedit:function(editor_, e_){
  //get combo1 record, then get combo1 value
  var rec= this.grid.store.getAt(rowIndexForCombo1);
  var cbo1Val = rec.data.COMBO_1;

  var cbo2 = e_.column.field || e_.column.editor;
  //pass combo 1 value to combo2 proxy as extraParam, then load combo2.
  cbo2.store.proxy.extraParams = {COMBO1VAL:cbo1Val};
  cbo2.store.load();
}

我认为当组合框变得模糊时,您可以过滤您的商店。

听众:{

focus : function(...){

        store.clearFilter();
        store.filterBy(function(item){
            return .....;//true or false;
        });
}

}