且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在另一个下拉菜单中加载一个下拉菜单中的值更改的商店

更新时间:2023-11-27 09:15:22

在该商店中,您可以定义从服务器发送的数据和字段。
数据可以用作本地或远程。


I have 2 dropdowns. Based on the value selected in one dropdown, I need to make AJAX call using JSON to retrive the values and make available in other dropdown. This needs to be done in EXTJS. I tried the following code:

FUNCTION_NAME_Field.on('select', function() {
  AGENT_NAME_Field.reset();
    agentNameStore.proxy= new Ext.data.HttpProxy({url: '/omsWeb/navigation/getAgent.htm?id='+FUNCTION_NAME_Field.getValue()});
    agentNameStore.load();
}); 

Here FUNCTION_NAME_Field is the first dropdown. agentNameStore is the store for second dropdown. But I am not getting what I need to write in:

var agentNameStore = Ext.create('Ext.data.Store', {
     // What should I write
    }); 

Could anyone please help?

In that store you can define your data and fields which is sent from server. data you can use as local or remote.