【发布时间】:2020-08-21 08:41:01
【问题描述】:
我有一个三个依赖的下拉菜单。
ex : 国家和城市。
我选择国家,会出现州,然后我选择州会出现城市。这是工作正常的创建流程。
现在在编辑流程中,我面临一个问题。在渲染时,我正在调用正在执行的加载存储方法,但它是针对州和国家/地区而不是针对国家/地区执行的。有什么办法可以延迟国家/地区的 store.load 以便它执行国家/地区,然后执行州和城市。
我的代码是
rendercombo: function () {
let _this = this,
combo = _this.getView(),
comboName = combo.name;
// Edit case flow.
// Some code
if (!Ext.isEmpty(combo.getValue())) {
let extraPramConfig = combo.extraconfig;
combo.extraconfig.selectedValue = combo.getValue();
_this.loadDropdownStore(extraPramConfig);
}
}
},
loadComboStore : function(config){
let _this = this;
combo = _this.getView(),
store = combo.getStore();
store.getProxy().setExtraParams(config);
// Here I want to execute my first combo then second and third
store.load({
callback: function (records) {
console.log(records);
}
});
}
在这里我想执行我的第一个组合,然后是第二个和第三个。任何有效的解决方案
【问题讨论】:
-
你可以为这个任务提供一些小提琴样本吗?
-
我将创建 3 个带有更改侦听器的组合。然后在一个或多个promise中调用store的load方法,beforeLoad根据每个combo的值改变params。
-
@devbnz 你有这方面的例子吗?
标签: javascript extjs extjs6