扩展js类库,在项目中建立一个 js文件,命名为:xxx.js 其代码为:
if ('function' !== typeof RegExp.escape)
{
RegExp.escape = function (s)
{
if ('string' !== typeof s)
{
return s;
}
return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
};
}
Ext.ns('Ext.form');
Ext.form.MultiSelect = Ext.extend(Ext.form.ComboBox,
{
checkField: 'checked',
multi: true,
separator: ',',
initComponent: function ()
{
if (!this.tpl)
{
this.tpl = '' + '
+ '
+ 'class="ux-MultiSelect-icon ux-MultiSelect-icon-'
+ '{[values.' + this.checkField + '?"checked":"unchecked"'
+ ']}">'
+ '{[values.' + this.displayField + ']}'
+ '
+ '';
}
Ext.form.MultiSelect.superclass.initComponent.apply(this, arguments);
this.on(
{
scope: this,
beforequery: this.onBeforeQuery,
blur: this.onRealBlur
});
this.onLoad = this.onLoad.createSequence(function ()
{
if (this.el)
{
v