Load the store of one dropdown on change of value in another dropdown

这一生的挚爱 提交于 2019-12-20 06:34:27

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/6859524/load-the-store-of-one-dropdown-on-change-of-value-in-another-dropdown

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!