diff --git a/dist/2.0/fineui.ie.js b/dist/2.0/fineui.ie.js index 07e9b96b58..e4c74e7e1c 100644 --- a/dist/2.0/fineui.ie.js +++ b/dist/2.0/fineui.ie.js @@ -88891,6 +88891,96 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/2.0/fineui.js b/dist/2.0/fineui.js index d5ca7830ed..34fdf779c2 100644 --- a/dist/2.0/fineui.js +++ b/dist/2.0/fineui.js @@ -89295,6 +89295,96 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index 07e9b96b58..e4c74e7e1c 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -88891,6 +88891,96 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/bundle.js b/dist/bundle.js index d5ca7830ed..34fdf779c2 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -89295,6 +89295,96 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index 883a770ce3..3b7580eff7 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -89136,6 +89136,96 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/fineui.js b/dist/fineui.js index 8b660952d6..1275f0999e 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -89540,6 +89540,96 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index 7cbd1d7ea2..49fbad460b 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -71840,6 +71840,96 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/widget.js b/dist/widget.js index df4cae5454..48b9b48630 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -26951,6 +26951,96 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/src/component/valuechooser/combo.valuechooser.insert.js b/src/component/valuechooser/combo.valuechooser.insert.js new file mode 100644 index 0000000000..0c155ea1ad --- /dev/null +++ b/src/component/valuechooser/combo.valuechooser.insert.js @@ -0,0 +1,91 @@ +/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo); \ No newline at end of file diff --git a/src/widget/numbereditor/number.editor.js b/src/widget/numbereditor/number.editor.js index c2d9223748..8ef971d40e 100644 --- a/src/widget/numbereditor/number.editor.js +++ b/src/widget/numbereditor/number.editor.js @@ -31,11 +31,10 @@ BI.NumberEditor = BI.inherit(BI.Widget, { errorText: o.errorText }); this.editor.on(BI.TextEditor.EVENT_CHANGE, function () { - o.value = BI.parseFloat(this.getValue()); self.fireEvent(BI.NumberEditor.EVENT_CHANGE); }); this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () { - this.setValue(BI.parseFloat(this.getValue())); + o.value = BI.parseFloat(this.getValue()); self.fireEvent(BI.NumberEditor.EVENT_CONFIRM); }); this.topBtn = BI.createWidget({