在另一个下拉菜单中加载一个下拉菜单中的值更改的商店 [英] Load the store of one dropdown on change of value in another dropdown

查看:88
本文介绍了在另一个下拉菜单中加载一个下拉菜单中的值更改的商店的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  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是第二个下拉列表的商店。
但是我没有得到我需要写的内容:

  var agentNameStore = Ext.create('Ext。 data.Store',{
//我该怎么写
});

任何人都可以帮忙?

解决方案

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


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.

这篇关于在另一个下拉菜单中加载一个下拉菜单中的值更改的商店的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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