问题
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