weixin_33737774 2009-04-30 10:53 采纳率: 0%
浏览 28

ExtJs级联组合问题

I Have an issue (maybe it will be my mistake using incorrectly ExtJs, I hope I do) using ExtJs to do a cascading-combos in a form. This is the situation:

  1. I have 3 combos, Zones, Regions, Cities
  2. When I click on one of them in order, the related one will be updated making an ajax request using Json as data format (so even if I think it's not useful, the sequence is the normal sequence Zones -> Regions -> Cities )
  3. Even if it's not so important, I'm on an ASP.NET MVC Back-end

The Issue arise when I, as the first operation a I do, first click on a descendant and then on the parent, for instance, if I just open before Regions, and then opening Zones and selecting one I hope it will fill the Regions well.. but nothing happens. In this case too the ajax-request is done correctly and the resulting Json data is returned well as the same returned "if I respect the click order (Zones -> Regions)".

Let me say that if, when I enter in the page the first time and a I do a normal click order, everything going well, but when I change the click order, as I said before, things will not work never more.

The code we using to do that is:

var RegionsStore = new Ext.data.JsonStore({
                              url:'/mypath/blabla',
                              fields:['Value','Text']
                   });
Ext.onReady(function() {
    Ext.getCmp('ext-Area').on('select', function(sender, item) {
        var target = Ext.getCmp('ext-Regions');
        target.setDisabled(true);
        target.setValue('');
        target.store.removeAll();
        target.displayField = 'Text';
        target.valueField = 'Value';
        target.store = RegionsStore;
        target.store.reload({
               params: { 
                  data: 'regions', 
                  discriminator: 'area', 
                  value: sender.getValue()
               }
        });
        target.setDisabled(false);
    });
});

Thanks in advance for any suggestions!

  • 写回答

2条回答 默认 最新

  • weixin_33749131 2009-05-01 10:24
    关注

    Call combo-2.store.clearFilter(); in first combo selection handler to clear second combo internal filter before you updating it.

    评论

报告相同问题?

悬赏问题

  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题