【问题标题】:Extjs 4.1 remove element from combox after loadingExtjs 4.1 加载后从组合框中删除元素
【发布时间】:2013-08-29 06:31:39
【问题描述】:

我有一个带有组合框的 MVC 面板,我会在他的存储(本地或远程)完成加载后从组合框中删除一些元素。

组合在此面板的视图中声明如下:

{
            xtype:'combo',
            name: 'type',
            editable: false,
            //a local simple store with two field: 'valueType' and 'text'
            store : Ext.create('AM.store.custompropview.propertyType'),
            valueField : 'valueType',
            fieldLabel: 'combo'
}

我尝试在控制器中控制事件“afterrender”或“boxready”,并尝试在函数中从商店中删除一些元素,但它根本不起作用。

  'combo[name="type"]' : {
            boxready:function(th, width, height, eOpts ){

                th.store.removeAt(0);
                th.store.removeAt(0);
                th.store.removeAt(0);

                }

我该怎么做?

谢谢

【问题讨论】:

    标签: javascript extjs combobox extjs4 extjs-mvc


    【解决方案1】:

    我认为您应该在加载商店后删除您的项目,而不仅仅是在您的组合呈现之后,以便您可以在控制器的 init 函数中对此进行编码:

    Ext.getStore('AM.store.custompropview.propertyType').on('load', function(store){
    store.removeAt(0);
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-26
      • 1970-01-01
      • 1970-01-01
      • 2013-04-03
      • 1970-01-01
      • 2013-01-11
      相关资源
      最近更新 更多