diff --git a/demo/js/widget/datetime/demo.datetime.js b/demo/js/widget/datetime/demo.datetime.js index 051529dbe..496b136d5 100644 --- a/demo/js/widget/datetime/demo.datetime.js +++ b/demo/js/widget/datetime/demo.datetime.js @@ -22,7 +22,15 @@ Demo.CustomDateTime = BI.inherit(BI.Widget, { eventName: BI.DateTimeCombo.EVENT_CANCEL, action: function () { } - }] + }], + value: { + year: 2017, + month: 2, + day: 23, + hour: 12, + minute: 11, + second: 1 + } }, top: 200, left: 200 diff --git a/dist/bundle.js b/dist/bundle.js index e43b85e49..00eb808ff 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -18197,8 +18197,16 @@ BI.BubblesController = BI.inherit(BI.Controller, { _init: function () { BI.BubblesController.superclass._init.apply(this, arguments); + var self = this; this.bubblesManager = {}; this.storeBubbles = {}; + BI.Resizers.add("bubbleController" + BI.uniqueId(), function () { + BI.each(self.bubblesManager, function (name) { + self.remove(name); + }); + self.bubblesManager = {}; + self.storeBubbles = {}; + }); }, _createBubble: function (direct, text, height) { @@ -67982,7 +67990,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { _init: function () { BI.TextValueCheckCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.trigger = BI.createWidget({ + this.trigger = BI.createWidget(o.el, { type: "bi.select_text_trigger", items: o.items, height: o.height, @@ -79189,7 +79197,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { BI.DateTimeCombo.superclass._init.apply(this, arguments); var self = this, opts = this.options; var date = Date.getDate(); - this.storeValue = { + this.storeValue = BI.isNotNull(opts.value) ? opts.value : { year: date.getFullYear(), month: date.getMonth(), day: date.getDate(), @@ -79200,13 +79208,15 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.date_time_trigger", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); this.popup = BI.createWidget({ type: "bi.date_time_popup", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); self.setValue(this.storeValue); @@ -79405,15 +79415,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, { }] }); - var date = Date.getDate(); - this.dateCombo.setValue({ - year: date.getFullYear(), - month: date.getMonth(), - day: date.getDate() - }); - this.hour.setValue(date.getHours()); - this.minute.setValue(date.getMinutes()); - this.second.setValue(date.getSeconds()); + this.setValue(opts.value); this.dateButton = BI.createWidget({ type: "bi.grid", @@ -79617,6 +79619,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, { el: this.text }] }); + this.setValue(o.value); }, _printTime: function (v) { diff --git a/dist/case.js b/dist/case.js index 5b09100de..e959347bb 100644 --- a/dist/case.js +++ b/dist/case.js @@ -5679,7 +5679,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { _init: function () { BI.TextValueCheckCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.trigger = BI.createWidget({ + this.trigger = BI.createWidget(o.el, { type: "bi.select_text_trigger", items: o.items, height: o.height, diff --git a/dist/core.js b/dist/core.js index a5fdc5c77..9ec2cb812 100644 --- a/dist/core.js +++ b/dist/core.js @@ -18197,8 +18197,16 @@ BI.BubblesController = BI.inherit(BI.Controller, { _init: function () { BI.BubblesController.superclass._init.apply(this, arguments); + var self = this; this.bubblesManager = {}; this.storeBubbles = {}; + BI.Resizers.add("bubbleController" + BI.uniqueId(), function () { + BI.each(self.bubblesManager, function (name) { + self.remove(name); + }); + self.bubblesManager = {}; + self.storeBubbles = {}; + }); }, _createBubble: function (direct, text, height) { diff --git a/dist/demo.js b/dist/demo.js index 03758c78e..90aa9fe4c 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -12337,7 +12337,15 @@ Demo.CustomDateTime = BI.inherit(BI.Widget, { eventName: BI.DateTimeCombo.EVENT_CANCEL, action: function () { } - }] + }], + value: { + year: 2017, + month: 2, + day: 23, + hour: 12, + minute: 11, + second: 1 + } }, top: 200, left: 200 diff --git a/dist/fineui.js b/dist/fineui.js index 1e3a8eeea..99614aead 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -18370,8 +18370,16 @@ BI.BubblesController = BI.inherit(BI.Controller, { _init: function () { BI.BubblesController.superclass._init.apply(this, arguments); + var self = this; this.bubblesManager = {}; this.storeBubbles = {}; + BI.Resizers.add("bubbleController" + BI.uniqueId(), function () { + BI.each(self.bubblesManager, function (name) { + self.remove(name); + }); + self.bubblesManager = {}; + self.storeBubbles = {}; + }); }, _createBubble: function (direct, text, height) { @@ -69676,7 +69684,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { _init: function () { BI.TextValueCheckCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.trigger = BI.createWidget({ + this.trigger = BI.createWidget(o.el, { type: "bi.select_text_trigger", items: o.items, height: o.height, @@ -80883,7 +80891,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { BI.DateTimeCombo.superclass._init.apply(this, arguments); var self = this, opts = this.options; var date = Date.getDate(); - this.storeValue = { + this.storeValue = BI.isNotNull(opts.value) ? opts.value : { year: date.getFullYear(), month: date.getMonth(), day: date.getDate(), @@ -80894,13 +80902,15 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.date_time_trigger", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); this.popup = BI.createWidget({ type: "bi.date_time_popup", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); self.setValue(this.storeValue); @@ -81099,15 +81109,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, { }] }); - var date = Date.getDate(); - this.dateCombo.setValue({ - year: date.getFullYear(), - month: date.getMonth(), - day: date.getDate() - }); - this.hour.setValue(date.getHours()); - this.minute.setValue(date.getMinutes()); - this.second.setValue(date.getSeconds()); + this.setValue(opts.value); this.dateButton = BI.createWidget({ type: "bi.grid", @@ -81311,6 +81313,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, { el: this.text }] }); + this.setValue(o.value); }, _printTime: function (v) { diff --git a/dist/widget.js b/dist/widget.js index a61399585..e487d1479 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -2758,7 +2758,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { BI.DateTimeCombo.superclass._init.apply(this, arguments); var self = this, opts = this.options; var date = Date.getDate(); - this.storeValue = { + this.storeValue = BI.isNotNull(opts.value) ? opts.value : { year: date.getFullYear(), month: date.getMonth(), day: date.getDate(), @@ -2769,13 +2769,15 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.date_time_trigger", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); this.popup = BI.createWidget({ type: "bi.date_time_popup", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); self.setValue(this.storeValue); @@ -2974,15 +2976,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, { }] }); - var date = Date.getDate(); - this.dateCombo.setValue({ - year: date.getFullYear(), - month: date.getMonth(), - day: date.getDate() - }); - this.hour.setValue(date.getHours()); - this.minute.setValue(date.getMinutes()); - this.second.setValue(date.getSeconds()); + this.setValue(opts.value); this.dateButton = BI.createWidget({ type: "bi.grid", @@ -3186,6 +3180,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, { el: this.text }] }); + this.setValue(o.value); }, _printTime: function (v) { diff --git a/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js b/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js index be1434eaa..9d373eda3 100644 --- a/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js +++ b/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js @@ -17,7 +17,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { _init: function () { BI.TextValueCheckCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.trigger = BI.createWidget({ + this.trigger = BI.createWidget(o.el, { type: "bi.select_text_trigger", items: o.items, height: o.height, diff --git a/src/core/controller/controller.bubbles.js b/src/core/controller/controller.bubbles.js index 63cf3607c..ce7fbb29e 100644 --- a/src/core/controller/controller.bubbles.js +++ b/src/core/controller/controller.bubbles.js @@ -16,8 +16,16 @@ BI.BubblesController = BI.inherit(BI.Controller, { _init: function () { BI.BubblesController.superclass._init.apply(this, arguments); + var self = this; this.bubblesManager = {}; this.storeBubbles = {}; + BI.Resizers.add("bubbleController" + BI.uniqueId(), function () { + BI.each(self.bubblesManager, function (name) { + self.remove(name); + }); + self.bubblesManager = {}; + self.storeBubbles = {}; + }); }, _createBubble: function (direct, text, height) { diff --git a/src/widget/datetime/datetime.combo.js b/src/widget/datetime/datetime.combo.js index b2d272255..a34413789 100644 --- a/src/widget/datetime/datetime.combo.js +++ b/src/widget/datetime/datetime.combo.js @@ -21,7 +21,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { BI.DateTimeCombo.superclass._init.apply(this, arguments); var self = this, opts = this.options; var date = Date.getDate(); - this.storeValue = { + this.storeValue = BI.isNotNull(opts.value) ? opts.value : { year: date.getFullYear(), month: date.getMonth(), day: date.getDate(), @@ -32,13 +32,15 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.date_time_trigger", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); this.popup = BI.createWidget({ type: "bi.date_time_popup", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); self.setValue(this.storeValue); diff --git a/src/widget/datetime/datetime.popup.js b/src/widget/datetime/datetime.popup.js index 11678623a..7137e5d94 100644 --- a/src/widget/datetime/datetime.popup.js +++ b/src/widget/datetime/datetime.popup.js @@ -106,15 +106,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, { }] }); - var date = Date.getDate(); - this.dateCombo.setValue({ - year: date.getFullYear(), - month: date.getMonth(), - day: date.getDate() - }); - this.hour.setValue(date.getHours()); - this.minute.setValue(date.getMinutes()); - this.second.setValue(date.getSeconds()); + this.setValue(opts.value); this.dateButton = BI.createWidget({ type: "bi.grid", diff --git a/src/widget/datetime/datetime.trigger.js b/src/widget/datetime/datetime.trigger.js index c6561c0ca..b23bc9a1f 100644 --- a/src/widget/datetime/datetime.trigger.js +++ b/src/widget/datetime/datetime.trigger.js @@ -36,6 +36,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, { el: this.text }] }); + this.setValue(o.value); }, _printTime: function (v) {