【问题标题】:Validator function IE6 in extjs combobox not workingextjs 组合框中的验证器功能 IE6 不起作用
【发布时间】:2012-04-16 09:41:28
【问题描述】:

我正在使用此代码来验证 IE6 中的 Combobox,这不起作用。

在 Firefox 和 Chrome 中可以正常工作。请建议我一些方法来验证 IE6 中的组合框。

代码:

xtype: 'combo',
            fieldLabel: 'Label',
            anchor: '100%',
            allowBlank: false,
            displayField: 'value',
            store: 'level1Store',
            lazyInit: false,
            mode: 'local',
            forceSelection: true,
            disableKeyFilter: true,
            editable: true,
            selectOnFocus: true,
            triggerAction: 'all',
            valueField: 'key',
            name: 1,
            ref: 'combo1',
            id: 'field1',
            validator: function(value){
                var temp = 0;
                for(var i=0;i<value.length;i++){
                    if(value[i]=="?"){
                        temp = temp + 1;
                    }
                }
                if(temp >3){
                    return false;
                }else{
                    return true;
                }
            }
        }

谢谢

拉吉

【问题讨论】:

  • 验证器()是否被调用?如果您在函数中放置一些跟踪 - 您应该能够查看它是否被调用。另外 - 控制台中是否有任何 JS 错误?

标签: extjs extjs3 extjs-mvc


【解决方案1】:
validator: function(value){
            var arr = value.split("?");
            if(arr.length >4) {
                return false;
            }else {
                return true;
            }
        }

这工作正常。

【讨论】:

    猜你喜欢
    • 2011-08-03
    • 2015-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多