在另一个下拉列表中的值发生变化时加载一个下拉列表的存储 [英] Load the store of one dropdown on change of value in another dropdown

查看:15
本文介绍了在另一个下拉列表中的值发生变化时加载一个下拉列表的存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 2 个下拉菜单.根据在一个下拉列表中选择的值,我需要使用 JSON 进行 AJAX 调用以检索值并在其他下拉列表中可用.这需要在 EXTJS 中完成.我尝试了以下代码:

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();
}); 

此处 FUNCTION_NAME_Field 是第一个下拉列表.agentNameStore 是第二个下拉列表的存储.但我没有得到我需要写的内容:

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
    }); 

有人可以帮忙吗?

推荐答案

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

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

这篇关于在另一个下拉列表中的值发生变化时加载一个下拉列表的存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆