有空值时如何过滤组合extjs? [英] How to filter combo extjs when there is empty value?

查看:81
本文介绍了有空值时如何过滤组合extjs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

组合框中的值未过滤,并且仍然显示"null"值.

Value in combo box doesn't filter and value "null" still show.

这段代码SkpdCombo.js,我没有发现什么错误.因此,请帮助我,这是什么错误,我应该如何使用此代码?

This code SkpdCombo.js and I didn't find what error. So please help me what's mistake and what should I do with this code?

Ext.define('App.view.skpd.SkpdCombo', {
    extend: 'App.view.CommonCombo',
    alias: 'widget.SkpdCombo',
    fieldLabel: 'Skpd',
    displayField:'_combo_',
    valueField: 'skpd_id',
    queryMode: 'remote',
    initComponent: function() {
        if (!this.store){
            this.store = new App.store.SkpdStore();
            this.store.load();
        }

        this.callParent();

        this.store.on('load', function(store, records, successful, operation, eOpts){
            var value_no = this.getValue();

            if (store.find('skpd_no', value_no) != null){
                this.setValue(value_no);
            }else{
                this.store.clearFilter(true);
            }
        }, this);
    }
});

好的,我等你的回答.谢谢.

Ok I'll wait for your answer guys. Thanks.

推荐答案

this.store.load();.

this.callParent(); 我认为一定是构造函数中的第一个调用.

Also this.callParent(); I think must be the first call in the constructor.

这篇关于有空值时如何过滤组合extjs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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