Browse Source

Merge pull request #314 in ~GUY/fineui from ~WINDY/fineui:master to master

* commit '68c8eed37645157890c06ae1b15ac896bdd0cc91':
  widget中的控件支持value
es6
windy 7 years ago
parent
commit
ff4a212584
  1. 2
      demo/js/widget/date/demo.datepane.js
  2. 7
      demo/js/widget/date/demo.multidate_combo.js
  3. 292
      demo/js/widget/downlist/demo.downlist.js
  4. 3
      demo/js/widget/month/demo.month.js
  5. 7
      demo/js/widget/numberinterval/demo.number_interval.js
  6. 3
      demo/js/widget/quarter/demo.quarter.js
  7. 11
      demo/js/widget/timeinterval/demo.time_interval.js
  8. 3
      demo/js/widget/year/demo.year.js
  9. 6
      demo/js/widget/yearmonth/demo.year_month_combo.js
  10. 6
      demo/js/widget/yearquarter/demo.year_quarter_combo.js
  11. 92
      dist/bundle.js
  12. 12
      dist/case.js
  13. 340
      dist/demo.js
  14. 92
      dist/fineui.js
  15. 80
      dist/widget.js
  16. 5
      src/case/combo/icontextvaluecombo/combo.icontextvalue.js
  17. 2
      src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js
  18. 5
      src/case/combo/textvaluecombo/combo.textvalue.js
  19. 1
      src/widget/date/trigger.date.js
  20. 1
      src/widget/datepane/datepane.js
  21. 6
      src/widget/month/combo.month.js
  22. 3
      src/widget/month/popup.month.js
  23. 1
      src/widget/month/trigger.month.js
  24. 10
      src/widget/multidate/multidate.combo.js
  25. 1
      src/widget/multidate/multidate.popup.js
  26. 2
      src/widget/numberinterval/numberinterval.js
  27. 6
      src/widget/quarter/combo.quarter.js
  28. 5
      src/widget/quarter/popup.quarter.js
  29. 1
      src/widget/quarter/trigger.quarter.js
  30. 12
      src/widget/timeinterval/timeinterval.js
  31. 6
      src/widget/year/combo.year.js
  32. 6
      src/widget/year/popup.year.js
  33. 3
      src/widget/year/trigger.year.js
  34. 8
      src/widget/yearmonth/combo.yearmonth.js
  35. 8
      src/widget/yearquarter/combo.yearquarter.js

2
demo/js/widget/date/demo.datepane.js

@ -17,7 +17,7 @@ Demo.DatePane = BI.inherit(BI.Widget, {
type: "bi.date_pane",
selectedTime: {
year: 2017,
month: 12,
month: 11,
day: 11
},
ref: function (_ref) {

7
demo/js/widget/date/demo.multidate_combo.js

@ -20,7 +20,12 @@ Demo.Date = BI.inherit(BI.Widget, {
ref: function () {
self.datecombo = this;
},
width: 300
width: 300,
value: {
year: 2018,
month: 1,
day: 23
}
}, {
type: "bi.button",
text: "getVlaue",

292
demo/js/widget/downlist/demo.downlist.js

@ -26,119 +26,6 @@ BICst.CONF.GROUP.NUMBER.WEEKDAY = 21;
BICst.CONF.GROUP.NUMBER.RENAME = 22;
BICst.CONF.GROUP.NUMBER.DELETE = 23;
// 数值字段汇总设置
var items = [[{
text: BI.i18nText("BI-Basic_Qiu_Sum"),
value: BICst.CONF.GROUP.NUMBER.SUM,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Avg"),
value: BICst.CONF.GROUP.NUMBER.AVG,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Median"),
value: BICst.CONF.GROUP.NUMBER.MEDIAN,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Max"),
value: BICst.CONF.GROUP.NUMBER.MAX,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Min"),
value: BICst.CONF.GROUP.NUMBER.MIN,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Standard_Deviation"),
value: BICst.CONF.GROUP.NUMBER.STANDARD_DEVIATION,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Variance"),
value: BICst.CONF.GROUP.NUMBER.VARIANCE,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_No_Repeat_Count"),
value: BICst.CONF.GROUP.NUMBER.COUNT,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Record_Count"),
value: BICst.CONF.GROUP.NUMBER.RECORD_COUNT,
cls: "dot-ha-font"
}], [{
text: BI.i18nText("BI-Basic_None"),
value: BICst.CONF.GROUP.NUMBER.NONE,
cls: "dot-ha-font"
}, {
el: {
text: BI.i18nText("BI-Basic_Qiu_Same_Period"),
value: BICst.CONF.GROUP.NUMBER.PERIOD,
cls: "dot-ha-font"
},
children: [{
text: BI.i18nText("BI-Basic_Multi_Date_Year"),
value: BICst.CONF.GROUP.NUMBER.YEAR,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Quarter"),
value: BICst.CONF.GROUP.NUMBER.QUARTER,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Month"),
value: BICst.CONF.GROUP.NUMBER.MONTH,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Week"),
value: BICst.CONF.GROUP.NUMBER.WEEK,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Week_XingQi"),
value: BICst.CONF.GROUP.NUMBER.WEEKDAY,
cls: "dot-ha-font"
}]
}, {
text: BI.i18nText("BI-Basic_Qiu_Same_Ring"),
value: BICst.CONF.GROUP.NUMBER.RING,
cls: "dot-ha-font"
}, {
el: {
text: BI.i18nText("BI-Basic_Qiu_Same_Period_Rate"),
value: BICst.CONF.GROUP.NUMBER.PERIOD_RATE,
cls: "dot-ha-font"
},
children: [{
text: BI.i18nText("BI-Basic_Multi_Date_Year"),
value: BICst.CONF.GROUP.NUMBER.YEAR,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Quarter"),
value: BICst.CONF.GROUP.NUMBER.QUARTER,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Month"),
value: BICst.CONF.GROUP.NUMBER.MONTH,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Week"),
value: BICst.CONF.GROUP.NUMBER.WEEK,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Week_XingQi"),
value: BICst.CONF.GROUP.NUMBER.WEEKDAY,
cls: "dot-ha-font"
}]
}, {
text: BI.i18nText("BI-Basic_Qiu_Same_Ring_Rate"),
value: BICst.CONF.GROUP.NUMBER.RING_RATE,
cls: "dot-ha-font"
}], [{
text: BI.i18nText("BI-Basic_Rename"),
value: BICst.CONF.GROUP.NUMBER.RENAME,
cls: "widget-combo-rename-edit-font"
}], [{
text: BI.i18nText("BI-Basic_Remove"),
value: BICst.CONF.GROUP.NUMBER.DELETE,
cls: "delete-h-font"
}]];
Demo.Downlist = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-downlist"
@ -167,98 +54,97 @@ Demo.Downlist = BI.inherit(BI.Widget, {
self.downlist = _ref;
},
cls: "layout-bg3",
//value: [{"childValue":22,"value":11},{"value":18},{"value":20}],
value: [{"childValue":22,"value":11},{"value":18},{"value":20}],
height: 30,
width: 100,
items: items
// items: [
// [{
// el: {
// text: "column 1111",
// iconCls1: "check-mark-e-font",
// value: 11
// },
// children: [{
// text: "column 1.1",
// value: 21,
// cls: "dot-e-font"
// }, {
// text: "column 1.222222222222222222222222222222222222",
// cls: "dot-e-font",
// value: 22
// }]
// }],
// [{
// el: {
// type: "bi.icon_text_icon_item",
// text: "column 2",
// iconCls1: "chart-type-e-font",
// cls: "dot-e-font",
// value: 12
// },
// disabled: true,
// children: [{
// type: "bi.icon_text_item",
// cls: "dot-e-font",
// height: 25,
// text: "column 2.1",
// value: 11
// }, {
// text: "column 2.2",
// value: 12,
// cls: "dot-e-font"
// }]
// }],
// [{
// text: "column 8",
// value: 18,
// cls: "dot-e-font"
// },
// {
//
// text: "column 9",
// cls: "dot-e-font",
// value: 19
// }
// ],
// [{
// text: "column 10",
// value: 20,
// cls: "dot-e-font"
// },
// {
//
// text: "column 11",
// cls: "dot-e-font",
// value: 21
// },
// {
//
// text: "column 12",
// cls: "dot-e-font",
// value: 22
// },
// {
//
// text: "column 13",
// cls: "dot-e-font",
// value: 23
// },
// {
//
// text: "column 14",
// cls: "dot-e-font",
// value: 24
// },
// {
//
// text: "column 15",
// cls: "dot-e-font",
// value: 23
// }
// ]
//
// ]
items: [
[{
el: {
text: "column 1111",
iconCls1: "check-mark-e-font",
value: 11
},
children: [{
text: "column 1.1",
value: 21,
cls: "dot-e-font"
}, {
text: "column 1.222222222222222222222222222222222222",
cls: "dot-e-font",
value: 22
}]
}],
[{
el: {
type: "bi.icon_text_icon_item",
text: "column 2",
iconCls1: "chart-type-e-font",
cls: "dot-e-font",
value: 12
},
disabled: true,
children: [{
type: "bi.icon_text_item",
cls: "dot-e-font",
height: 25,
text: "column 2.1",
value: 11
}, {
text: "column 2.2",
value: 12,
cls: "dot-e-font"
}]
}],
[{
text: "column 8",
value: 18,
cls: "dot-e-font"
},
{
text: "column 9",
cls: "dot-e-font",
value: 19
}
],
[{
text: "column 10",
value: 20,
cls: "dot-e-font"
},
{
text: "column 11",
cls: "dot-e-font",
value: 21
},
{
text: "column 12",
cls: "dot-e-font",
value: 22
},
{
text: "column 13",
cls: "dot-e-font",
value: 23
},
{
text: "column 14",
cls: "dot-e-font",
value: 24
},
{
text: "column 15",
cls: "dot-e-font",
value: 23
}
]
]
}, {
type: "bi.label",
text: "显示选择值",

3
demo/js/widget/month/demo.month.js

@ -14,7 +14,8 @@ Demo.Month = BI.inherit(BI.Widget, {
width: 300,
ref: function () {
self.monthcombo = this;
}
},
value: 11
}, {
type: "bi.button",
text: "getValue",

7
demo/js/widget/numberinterval/demo.number_interval.js

@ -26,7 +26,12 @@ Demo.NumericalInterval = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.numerical = _ref;
},
width: 500
width: 500,
value: {
max: 300,
closeMax: true,
closeMin: false
}
}, {
type: "bi.label",
ref: function (_ref) {

3
demo/js/widget/quarter/demo.quarter.js

@ -14,7 +14,8 @@ Demo.Quarter = BI.inherit(BI.Widget, {
width: 300,
ref: function () {
self.quartercombo = this;
}
},
value: 3
}, {
type: "bi.button",
text: "getValue",

11
demo/js/widget/timeinterval/demo.time_interval.js

@ -16,6 +16,17 @@ Demo.TimeInterval = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.interval = _ref;
},
value: {
start: {
type: 1,
value: 2
},
end: {
year: 2018,
month: 0,
day: 12
}
},
width: 300
}, {
type: "bi.button",

3
demo/js/widget/year/demo.year.js

@ -14,7 +14,8 @@ Demo.Year = BI.inherit(BI.Widget, {
width: 300,
ref: function () {
self.yearcombo = this;
}
},
value: 2017
}, {
type: "bi.button",
text: "getValue",

6
demo/js/widget/yearmonth/demo.year_month_combo.js

@ -15,7 +15,11 @@ Demo.YearMonthCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.widget = _ref;
},
width: 300
width: 300,
value:{
year: 2018,
month: 0
}
}, {
type: "bi.button",
text: "getValue",

6
demo/js/widget/yearquarter/demo.year_quarter_combo.js

@ -16,7 +16,11 @@ Demo.YearQuarterCombo = BI.inherit(BI.Widget, {
self.widget = _ref;
},
yearBehaviors: {},
quarterBehaviors: {}
quarterBehaviors: {},
value: {
year: 2018,
quarter: 1
}
}, {
type: "bi.button",
text: "getValue",

92
dist/bundle.js vendored

@ -67811,15 +67811,14 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-icon-text-value-combo",
height: 30,
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_icon_text_trigger",
items: o.items,
height: o.height,
@ -68016,7 +68015,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(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
@ -68214,15 +68213,14 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
height: 30,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.TextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
@ -78833,6 +78831,7 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
el: this.editor
}]
});
this.setValue(o.value);
},
_dateCheck: function (date) {
return Date.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || Date.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || Date.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || Date.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
@ -79109,6 +79108,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
this.setValue(o.selectedTime);
},
@ -82846,7 +82846,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.month_trigger"
type: "bi.month_trigger",
value: o.value
});
this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM, function (v) {
@ -82874,7 +82875,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
this.popup = BI.createWidget({
type: "bi.month_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.MonthPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -82972,7 +82974,8 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
type: "bi.center_adapt",
vgap: 1,
hgap: 2
}]
}],
value: o.value
});
this.month.on(BI.Controller.EVENT_CHANGE, function (type) {
@ -83077,6 +83080,7 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
if(BI.isNotNull(v)) {
@ -83277,11 +83281,12 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = Date.getDate();
this.storeValue = null;
this.storeValue = opts.value;
this.trigger = BI.createWidget({
type: "bi.date_trigger",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.trigger.on(BI.DateTrigger.EVENT_KEY_DOWN, function () {
if (self.combo.isViewVisible()) {
@ -83335,7 +83340,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
this.popup = BI.createWidget({
type: "bi.multidate_popup",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.popup.on(BI.MultiDatePopup.BUTTON_CLEAR_EVENT_CHANGE, function () {
self.setValue();
@ -83429,6 +83435,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.comboWrapper = _ref;
}
});
this._checkDynamicValue(opts.value);
},
_checkDynamicValue: function (v) {
@ -83826,6 +83834,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
height: 30
}]
});
this.setValue(opts.value);
},
_setInnerValue: function (obj) {
if (this.dateTab.getSelect() === BI.MultiDateCombo.MULTI_DATE_YMD_CARD) {
@ -89598,6 +89607,8 @@ BI.NumberInterval = BI.inherit(BI.Single, {
self._setComboValueChangedEvent(self.smallCombo);
self._setEditorValueChangedEvent(self.bigEditor);
self._setEditorValueChangedEvent(self.smallEditor);
this.setValue(o.value);
},
_checkValidation: function () {
@ -91090,7 +91101,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.storeValue = "";
this.trigger = BI.createWidget({
type: "bi.quarter_trigger"
type: "bi.quarter_trigger",
value: o.value
});
this.trigger.on(BI.QuarterTrigger.EVENT_FOCUS, function () {
@ -91117,7 +91129,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.quarter_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.QuarterPopup.EVENT_CHANGE, function () {
@ -91175,7 +91188,7 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
var items = [{
text: Date._QN[01],
text: Date._QN[1],
value: 1
}, {
text: Date._QN[2],
@ -91206,7 +91219,8 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
items: BI.createItems(items, {}),
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.quarter.on(BI.Controller.EVENT_CHANGE, function (type) {
@ -91313,6 +91327,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
@ -97044,11 +97059,12 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_init: function () {
var self = this;
var self = this, o = this.options;
BI.TimeInterval.superclass._init.apply(this, arguments);
this.left = this._createCombo();
this.right = this._createCombo();
o.value = o.value || {};
this.left = this._createCombo(o.value.start);
this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({
type: "bi.label",
height: this.constants.height,
@ -97089,10 +97105,11 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_createCombo: function () {
_createCombo: function (v) {
var self = this;
var combo = BI.createWidget({
type: "bi.multidate_combo"
type: "bi.multidate_combo",
value: v
});
combo.on(BI.MultiDateCombo.EVENT_ERROR, function () {
self._clearTitle();
@ -97236,7 +97253,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
this.trigger = BI.createWidget({
type: "bi.year_trigger",
min: o.min,
max: o.max
max: o.max,
value: o.value || ""
});
this.trigger.on(BI.YearTrigger.EVENT_FOCUS, function () {
self.storeValue = this.getKey();
@ -97288,7 +97306,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
behaviors: o.behaviors,
min: o.min,
max: o.max
}
},
value: o.value || ""
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
@ -97351,7 +97370,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
_init: function () {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.selectedYear = this._year = Date.getDate().getFullYear();
@ -97398,6 +97417,10 @@ BI.YearPopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.YearPopup.EVENT_CHANGE, self.selectedYear);
});
if(BI.isKey(o.value)){
this.setValue(o.value);
}
},
getValue: function () {
@ -97458,7 +97481,8 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true,
errorText: c.errorText
errorText: c.errorText,
value: o.value
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.YearTrigger.EVENT_FOCUS);
@ -97542,14 +97566,18 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
BI.YearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.month = BI.createWidget({
type: "bi.month_combo",
behaviors: o.monthBehaviors
behaviors: o.monthBehaviors,
value: o.value.month
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {
@ -97609,14 +97637,18 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
BI.YearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.quarter = BI.createWidget({
type: "bi.quarter_combo",
behaviors: o.quarterBehaviors
behaviors: o.quarterBehaviors,
value: o.value.quarter
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {

12
dist/case.js vendored

@ -5474,15 +5474,14 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-icon-text-value-combo",
height: 30,
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_icon_text_trigger",
items: o.items,
height: o.height,
@ -5679,7 +5678,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(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
@ -5877,15 +5876,14 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
height: 30,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.TextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,

340
dist/demo.js vendored

@ -12232,7 +12232,7 @@ BI.shortcut("demo.tips", Demo.Tips);Demo.DatePane = BI.inherit(BI.Widget, {
type: "bi.date_pane",
selectedTime: {
year: 2017,
month: 12,
month: 11,
day: 11
},
ref: function (_ref) {
@ -12289,7 +12289,12 @@ Demo.Date = BI.inherit(BI.Widget, {
ref: function () {
self.datecombo = this;
},
width: 300
width: 300,
value: {
year: 2018,
month: 1,
day: 23
}
}, {
type: "bi.button",
text: "getVlaue",
@ -12381,119 +12386,6 @@ BICst.CONF.GROUP.NUMBER.WEEKDAY = 21;
BICst.CONF.GROUP.NUMBER.RENAME = 22;
BICst.CONF.GROUP.NUMBER.DELETE = 23;
// 数值字段汇总设置
var items = [[{
text: BI.i18nText("BI-Basic_Qiu_Sum"),
value: BICst.CONF.GROUP.NUMBER.SUM,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Avg"),
value: BICst.CONF.GROUP.NUMBER.AVG,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Median"),
value: BICst.CONF.GROUP.NUMBER.MEDIAN,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Max"),
value: BICst.CONF.GROUP.NUMBER.MAX,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Min"),
value: BICst.CONF.GROUP.NUMBER.MIN,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Standard_Deviation"),
value: BICst.CONF.GROUP.NUMBER.STANDARD_DEVIATION,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Variance"),
value: BICst.CONF.GROUP.NUMBER.VARIANCE,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_No_Repeat_Count"),
value: BICst.CONF.GROUP.NUMBER.COUNT,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Record_Count"),
value: BICst.CONF.GROUP.NUMBER.RECORD_COUNT,
cls: "dot-ha-font"
}], [{
text: BI.i18nText("BI-Basic_None"),
value: BICst.CONF.GROUP.NUMBER.NONE,
cls: "dot-ha-font"
}, {
el: {
text: BI.i18nText("BI-Basic_Qiu_Same_Period"),
value: BICst.CONF.GROUP.NUMBER.PERIOD,
cls: "dot-ha-font"
},
children: [{
text: BI.i18nText("BI-Basic_Multi_Date_Year"),
value: BICst.CONF.GROUP.NUMBER.YEAR,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Quarter"),
value: BICst.CONF.GROUP.NUMBER.QUARTER,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Month"),
value: BICst.CONF.GROUP.NUMBER.MONTH,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Week"),
value: BICst.CONF.GROUP.NUMBER.WEEK,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Week_XingQi"),
value: BICst.CONF.GROUP.NUMBER.WEEKDAY,
cls: "dot-ha-font"
}]
}, {
text: BI.i18nText("BI-Basic_Qiu_Same_Ring"),
value: BICst.CONF.GROUP.NUMBER.RING,
cls: "dot-ha-font"
}, {
el: {
text: BI.i18nText("BI-Basic_Qiu_Same_Period_Rate"),
value: BICst.CONF.GROUP.NUMBER.PERIOD_RATE,
cls: "dot-ha-font"
},
children: [{
text: BI.i18nText("BI-Basic_Multi_Date_Year"),
value: BICst.CONF.GROUP.NUMBER.YEAR,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Quarter"),
value: BICst.CONF.GROUP.NUMBER.QUARTER,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Month"),
value: BICst.CONF.GROUP.NUMBER.MONTH,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Week"),
value: BICst.CONF.GROUP.NUMBER.WEEK,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Week_XingQi"),
value: BICst.CONF.GROUP.NUMBER.WEEKDAY,
cls: "dot-ha-font"
}]
}, {
text: BI.i18nText("BI-Basic_Qiu_Same_Ring_Rate"),
value: BICst.CONF.GROUP.NUMBER.RING_RATE,
cls: "dot-ha-font"
}], [{
text: BI.i18nText("BI-Basic_Rename"),
value: BICst.CONF.GROUP.NUMBER.RENAME,
cls: "widget-combo-rename-edit-font"
}], [{
text: BI.i18nText("BI-Basic_Remove"),
value: BICst.CONF.GROUP.NUMBER.DELETE,
cls: "delete-h-font"
}]];
Demo.Downlist = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-downlist"
@ -12522,98 +12414,97 @@ Demo.Downlist = BI.inherit(BI.Widget, {
self.downlist = _ref;
},
cls: "layout-bg3",
//value: [{"childValue":22,"value":11},{"value":18},{"value":20}],
value: [{"childValue":22,"value":11},{"value":18},{"value":20}],
height: 30,
width: 100,
items: items
// items: [
// [{
// el: {
// text: "column 1111",
// iconCls1: "check-mark-e-font",
// value: 11
// },
// children: [{
// text: "column 1.1",
// value: 21,
// cls: "dot-e-font"
// }, {
// text: "column 1.222222222222222222222222222222222222",
// cls: "dot-e-font",
// value: 22
// }]
// }],
// [{
// el: {
// type: "bi.icon_text_icon_item",
// text: "column 2",
// iconCls1: "chart-type-e-font",
// cls: "dot-e-font",
// value: 12
// },
// disabled: true,
// children: [{
// type: "bi.icon_text_item",
// cls: "dot-e-font",
// height: 25,
// text: "column 2.1",
// value: 11
// }, {
// text: "column 2.2",
// value: 12,
// cls: "dot-e-font"
// }]
// }],
// [{
// text: "column 8",
// value: 18,
// cls: "dot-e-font"
// },
// {
//
// text: "column 9",
// cls: "dot-e-font",
// value: 19
// }
// ],
// [{
// text: "column 10",
// value: 20,
// cls: "dot-e-font"
// },
// {
//
// text: "column 11",
// cls: "dot-e-font",
// value: 21
// },
// {
//
// text: "column 12",
// cls: "dot-e-font",
// value: 22
// },
// {
//
// text: "column 13",
// cls: "dot-e-font",
// value: 23
// },
// {
//
// text: "column 14",
// cls: "dot-e-font",
// value: 24
// },
// {
//
// text: "column 15",
// cls: "dot-e-font",
// value: 23
// }
// ]
//
// ]
items: [
[{
el: {
text: "column 1111",
iconCls1: "check-mark-e-font",
value: 11
},
children: [{
text: "column 1.1",
value: 21,
cls: "dot-e-font"
}, {
text: "column 1.222222222222222222222222222222222222",
cls: "dot-e-font",
value: 22
}]
}],
[{
el: {
type: "bi.icon_text_icon_item",
text: "column 2",
iconCls1: "chart-type-e-font",
cls: "dot-e-font",
value: 12
},
disabled: true,
children: [{
type: "bi.icon_text_item",
cls: "dot-e-font",
height: 25,
text: "column 2.1",
value: 11
}, {
text: "column 2.2",
value: 12,
cls: "dot-e-font"
}]
}],
[{
text: "column 8",
value: 18,
cls: "dot-e-font"
},
{
text: "column 9",
cls: "dot-e-font",
value: 19
}
],
[{
text: "column 10",
value: 20,
cls: "dot-e-font"
},
{
text: "column 11",
cls: "dot-e-font",
value: 21
},
{
text: "column 12",
cls: "dot-e-font",
value: 22
},
{
text: "column 13",
cls: "dot-e-font",
value: 23
},
{
text: "column 14",
cls: "dot-e-font",
value: 24
},
{
text: "column 15",
cls: "dot-e-font",
value: 23
}
]
]
}, {
type: "bi.label",
text: "显示选择值",
@ -12752,7 +12643,8 @@ Demo.Month = BI.inherit(BI.Widget, {
width: 300,
ref: function () {
self.monthcombo = this;
}
},
value: 11
}, {
type: "bi.button",
text: "getValue",
@ -12979,7 +12871,12 @@ Demo.NumericalInterval = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.numerical = _ref;
},
width: 500
width: 500,
value: {
max: 300,
closeMax: true,
closeMin: false
}
}, {
type: "bi.label",
ref: function (_ref) {
@ -13260,7 +13157,8 @@ Demo.Quarter = BI.inherit(BI.Widget, {
width: 300,
ref: function () {
self.quartercombo = this;
}
},
value: 3
}, {
type: "bi.button",
text: "getValue",
@ -14518,6 +14416,17 @@ Demo.TimeInterval = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.interval = _ref;
},
value: {
start: {
type: 1,
value: 2
},
end: {
year: 2018,
month: 0,
day: 12
}
},
width: 300
}, {
type: "bi.button",
@ -14788,7 +14697,8 @@ Demo.Year = BI.inherit(BI.Widget, {
width: 300,
ref: function () {
self.yearcombo = this;
}
},
value: 2017
}, {
type: "bi.button",
text: "getValue",
@ -14826,7 +14736,11 @@ Demo.YearMonthCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.widget = _ref;
},
width: 300
width: 300,
value:{
year: 2018,
month: 0
}
}, {
type: "bi.button",
text: "getValue",
@ -14868,7 +14782,11 @@ Demo.YearQuarterCombo = BI.inherit(BI.Widget, {
self.widget = _ref;
},
yearBehaviors: {},
quarterBehaviors: {}
quarterBehaviors: {},
value: {
year: 2018,
quarter: 1
}
}, {
type: "bi.button",
text: "getValue",

92
dist/fineui.js vendored

@ -69537,15 +69537,14 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-icon-text-value-combo",
height: 30,
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_icon_text_trigger",
items: o.items,
height: o.height,
@ -69742,7 +69741,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(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
@ -69940,15 +69939,14 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
height: 30,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.TextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
@ -80559,6 +80557,7 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
el: this.editor
}]
});
this.setValue(o.value);
},
_dateCheck: function (date) {
return Date.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || Date.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || Date.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || Date.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
@ -80835,6 +80834,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
this.setValue(o.selectedTime);
},
@ -84572,7 +84572,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.month_trigger"
type: "bi.month_trigger",
value: o.value
});
this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM, function (v) {
@ -84600,7 +84601,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
this.popup = BI.createWidget({
type: "bi.month_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.MonthPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -84698,7 +84700,8 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
type: "bi.center_adapt",
vgap: 1,
hgap: 2
}]
}],
value: o.value
});
this.month.on(BI.Controller.EVENT_CHANGE, function (type) {
@ -84803,6 +84806,7 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
if(BI.isNotNull(v)) {
@ -85003,11 +85007,12 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = Date.getDate();
this.storeValue = null;
this.storeValue = opts.value;
this.trigger = BI.createWidget({
type: "bi.date_trigger",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.trigger.on(BI.DateTrigger.EVENT_KEY_DOWN, function () {
if (self.combo.isViewVisible()) {
@ -85061,7 +85066,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
this.popup = BI.createWidget({
type: "bi.multidate_popup",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.popup.on(BI.MultiDatePopup.BUTTON_CLEAR_EVENT_CHANGE, function () {
self.setValue();
@ -85155,6 +85161,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.comboWrapper = _ref;
}
});
this._checkDynamicValue(opts.value);
},
_checkDynamicValue: function (v) {
@ -85552,6 +85560,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
height: 30
}]
});
this.setValue(opts.value);
},
_setInnerValue: function (obj) {
if (this.dateTab.getSelect() === BI.MultiDateCombo.MULTI_DATE_YMD_CARD) {
@ -91324,6 +91333,8 @@ BI.NumberInterval = BI.inherit(BI.Single, {
self._setComboValueChangedEvent(self.smallCombo);
self._setEditorValueChangedEvent(self.bigEditor);
self._setEditorValueChangedEvent(self.smallEditor);
this.setValue(o.value);
},
_checkValidation: function () {
@ -92816,7 +92827,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.storeValue = "";
this.trigger = BI.createWidget({
type: "bi.quarter_trigger"
type: "bi.quarter_trigger",
value: o.value
});
this.trigger.on(BI.QuarterTrigger.EVENT_FOCUS, function () {
@ -92843,7 +92855,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.quarter_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.QuarterPopup.EVENT_CHANGE, function () {
@ -92901,7 +92914,7 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
var items = [{
text: Date._QN[01],
text: Date._QN[1],
value: 1
}, {
text: Date._QN[2],
@ -92932,7 +92945,8 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
items: BI.createItems(items, {}),
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.quarter.on(BI.Controller.EVENT_CHANGE, function (type) {
@ -93039,6 +93053,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
@ -98770,11 +98785,12 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_init: function () {
var self = this;
var self = this, o = this.options;
BI.TimeInterval.superclass._init.apply(this, arguments);
this.left = this._createCombo();
this.right = this._createCombo();
o.value = o.value || {};
this.left = this._createCombo(o.value.start);
this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({
type: "bi.label",
height: this.constants.height,
@ -98815,10 +98831,11 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_createCombo: function () {
_createCombo: function (v) {
var self = this;
var combo = BI.createWidget({
type: "bi.multidate_combo"
type: "bi.multidate_combo",
value: v
});
combo.on(BI.MultiDateCombo.EVENT_ERROR, function () {
self._clearTitle();
@ -98962,7 +98979,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
this.trigger = BI.createWidget({
type: "bi.year_trigger",
min: o.min,
max: o.max
max: o.max,
value: o.value || ""
});
this.trigger.on(BI.YearTrigger.EVENT_FOCUS, function () {
self.storeValue = this.getKey();
@ -99014,7 +99032,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
behaviors: o.behaviors,
min: o.min,
max: o.max
}
},
value: o.value || ""
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
@ -99077,7 +99096,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
_init: function () {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.selectedYear = this._year = Date.getDate().getFullYear();
@ -99124,6 +99143,10 @@ BI.YearPopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.YearPopup.EVENT_CHANGE, self.selectedYear);
});
if(BI.isKey(o.value)){
this.setValue(o.value);
}
},
getValue: function () {
@ -99184,7 +99207,8 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true,
errorText: c.errorText
errorText: c.errorText,
value: o.value
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.YearTrigger.EVENT_FOCUS);
@ -99268,14 +99292,18 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
BI.YearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.month = BI.createWidget({
type: "bi.month_combo",
behaviors: o.monthBehaviors
behaviors: o.monthBehaviors,
value: o.value.month
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {
@ -99335,14 +99363,18 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
BI.YearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.quarter = BI.createWidget({
type: "bi.quarter_combo",
behaviors: o.quarterBehaviors
behaviors: o.quarterBehaviors,
value: o.value.quarter
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {

80
dist/widget.js vendored

@ -2399,6 +2399,7 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
el: this.editor
}]
});
this.setValue(o.value);
},
_dateCheck: function (date) {
return Date.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || Date.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || Date.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || Date.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
@ -2675,6 +2676,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
this.setValue(o.selectedTime);
},
@ -6412,7 +6414,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.month_trigger"
type: "bi.month_trigger",
value: o.value
});
this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM, function (v) {
@ -6440,7 +6443,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
this.popup = BI.createWidget({
type: "bi.month_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.MonthPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -6538,7 +6542,8 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
type: "bi.center_adapt",
vgap: 1,
hgap: 2
}]
}],
value: o.value
});
this.month.on(BI.Controller.EVENT_CHANGE, function (type) {
@ -6643,6 +6648,7 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
if(BI.isNotNull(v)) {
@ -6843,11 +6849,12 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = Date.getDate();
this.storeValue = null;
this.storeValue = opts.value;
this.trigger = BI.createWidget({
type: "bi.date_trigger",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.trigger.on(BI.DateTrigger.EVENT_KEY_DOWN, function () {
if (self.combo.isViewVisible()) {
@ -6901,7 +6908,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
this.popup = BI.createWidget({
type: "bi.multidate_popup",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.popup.on(BI.MultiDatePopup.BUTTON_CLEAR_EVENT_CHANGE, function () {
self.setValue();
@ -6995,6 +7003,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.comboWrapper = _ref;
}
});
this._checkDynamicValue(opts.value);
},
_checkDynamicValue: function (v) {
@ -7392,6 +7402,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
height: 30
}]
});
this.setValue(opts.value);
},
_setInnerValue: function (obj) {
if (this.dateTab.getSelect() === BI.MultiDateCombo.MULTI_DATE_YMD_CARD) {
@ -13164,6 +13175,8 @@ BI.NumberInterval = BI.inherit(BI.Single, {
self._setComboValueChangedEvent(self.smallCombo);
self._setEditorValueChangedEvent(self.bigEditor);
self._setEditorValueChangedEvent(self.smallEditor);
this.setValue(o.value);
},
_checkValidation: function () {
@ -14656,7 +14669,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.storeValue = "";
this.trigger = BI.createWidget({
type: "bi.quarter_trigger"
type: "bi.quarter_trigger",
value: o.value
});
this.trigger.on(BI.QuarterTrigger.EVENT_FOCUS, function () {
@ -14683,7 +14697,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.quarter_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.QuarterPopup.EVENT_CHANGE, function () {
@ -14741,7 +14756,7 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
var items = [{
text: Date._QN[01],
text: Date._QN[1],
value: 1
}, {
text: Date._QN[2],
@ -14772,7 +14787,8 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
items: BI.createItems(items, {}),
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.quarter.on(BI.Controller.EVENT_CHANGE, function (type) {
@ -14879,6 +14895,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
@ -20610,11 +20627,12 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_init: function () {
var self = this;
var self = this, o = this.options;
BI.TimeInterval.superclass._init.apply(this, arguments);
this.left = this._createCombo();
this.right = this._createCombo();
o.value = o.value || {};
this.left = this._createCombo(o.value.start);
this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({
type: "bi.label",
height: this.constants.height,
@ -20655,10 +20673,11 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_createCombo: function () {
_createCombo: function (v) {
var self = this;
var combo = BI.createWidget({
type: "bi.multidate_combo"
type: "bi.multidate_combo",
value: v
});
combo.on(BI.MultiDateCombo.EVENT_ERROR, function () {
self._clearTitle();
@ -20802,7 +20821,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
this.trigger = BI.createWidget({
type: "bi.year_trigger",
min: o.min,
max: o.max
max: o.max,
value: o.value || ""
});
this.trigger.on(BI.YearTrigger.EVENT_FOCUS, function () {
self.storeValue = this.getKey();
@ -20854,7 +20874,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
behaviors: o.behaviors,
min: o.min,
max: o.max
}
},
value: o.value || ""
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
@ -20917,7 +20938,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
_init: function () {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.selectedYear = this._year = Date.getDate().getFullYear();
@ -20964,6 +20985,10 @@ BI.YearPopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.YearPopup.EVENT_CHANGE, self.selectedYear);
});
if(BI.isKey(o.value)){
this.setValue(o.value);
}
},
getValue: function () {
@ -21024,7 +21049,8 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true,
errorText: c.errorText
errorText: c.errorText,
value: o.value
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.YearTrigger.EVENT_FOCUS);
@ -21108,14 +21134,18 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
BI.YearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.month = BI.createWidget({
type: "bi.month_combo",
behaviors: o.monthBehaviors
behaviors: o.monthBehaviors,
value: o.value.month
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {
@ -21175,14 +21205,18 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
BI.YearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.quarter = BI.createWidget({
type: "bi.quarter_combo",
behaviors: o.quarterBehaviors
behaviors: o.quarterBehaviors,
value: o.value.quarter
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {

5
src/case/combo/icontextvaluecombo/combo.icontextvalue.js

@ -7,15 +7,14 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-icon-text-value-combo",
height: 30,
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_icon_text_trigger",
items: o.items,
height: o.height,

2
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(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,

5
src/case/combo/textvaluecombo/combo.textvalue.js

@ -11,15 +11,14 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
height: 30,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.TextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,

1
src/widget/date/trigger.date.js

@ -98,6 +98,7 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
el: this.editor
}]
});
this.setValue(o.value);
},
_dateCheck: function (date) {
return Date.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || Date.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || Date.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || Date.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;

1
src/widget/datepane/datepane.js

@ -59,6 +59,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
this.setValue(o.selectedTime);
},

6
src/widget/month/combo.month.js

@ -18,7 +18,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.month_trigger"
type: "bi.month_trigger",
value: o.value
});
this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM, function (v) {
@ -46,7 +47,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
this.popup = BI.createWidget({
type: "bi.month_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.MonthPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());

3
src/widget/month/popup.month.js

@ -60,7 +60,8 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
type: "bi.center_adapt",
vgap: 1,
hgap: 2
}]
}],
value: o.value
});
this.month.on(BI.Controller.EVENT_CHANGE, function (type) {

1
src/widget/month/trigger.month.js

@ -83,6 +83,7 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
if(BI.isNotNull(v)) {

10
src/widget/multidate/multidate.combo.js

@ -23,11 +23,12 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = Date.getDate();
this.storeValue = null;
this.storeValue = opts.value;
this.trigger = BI.createWidget({
type: "bi.date_trigger",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.trigger.on(BI.DateTrigger.EVENT_KEY_DOWN, function () {
if (self.combo.isViewVisible()) {
@ -81,7 +82,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
this.popup = BI.createWidget({
type: "bi.multidate_popup",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.popup.on(BI.MultiDatePopup.BUTTON_CLEAR_EVENT_CHANGE, function () {
self.setValue();
@ -175,6 +177,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.comboWrapper = _ref;
}
});
this._checkDynamicValue(opts.value);
},
_checkDynamicValue: function (v) {

1
src/widget/multidate/multidate.popup.js

@ -202,6 +202,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
height: 30
}]
});
this.setValue(opts.value);
},
_setInnerValue: function (obj) {
if (this.dateTab.getSelect() === BI.MultiDateCombo.MULTI_DATE_YMD_CARD) {

2
src/widget/numberinterval/numberinterval.js

@ -236,6 +236,8 @@ BI.NumberInterval = BI.inherit(BI.Single, {
self._setComboValueChangedEvent(self.smallCombo);
self._setEditorValueChangedEvent(self.bigEditor);
self._setEditorValueChangedEvent(self.smallEditor);
this.setValue(o.value);
},
_checkValidation: function () {

6
src/widget/quarter/combo.quarter.js

@ -18,7 +18,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.storeValue = "";
this.trigger = BI.createWidget({
type: "bi.quarter_trigger"
type: "bi.quarter_trigger",
value: o.value
});
this.trigger.on(BI.QuarterTrigger.EVENT_FOCUS, function () {
@ -45,7 +46,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.quarter_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.QuarterPopup.EVENT_CHANGE, function () {

5
src/widget/quarter/popup.quarter.js

@ -19,7 +19,7 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
var items = [{
text: Date._QN[01],
text: Date._QN[1],
value: 1
}, {
text: Date._QN[2],
@ -50,7 +50,8 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
items: BI.createItems(items, {}),
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.quarter.on(BI.Controller.EVENT_CHANGE, function (type) {

1
src/widget/quarter/trigger.quarter.js

@ -85,6 +85,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {

12
src/widget/timeinterval/timeinterval.js

@ -18,11 +18,12 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_init: function () {
var self = this;
var self = this, o = this.options;
BI.TimeInterval.superclass._init.apply(this, arguments);
this.left = this._createCombo();
this.right = this._createCombo();
o.value = o.value || {};
this.left = this._createCombo(o.value.start);
this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({
type: "bi.label",
height: this.constants.height,
@ -63,10 +64,11 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_createCombo: function () {
_createCombo: function (v) {
var self = this;
var combo = BI.createWidget({
type: "bi.multidate_combo"
type: "bi.multidate_combo",
value: v
});
combo.on(BI.MultiDateCombo.EVENT_ERROR, function () {
self._clearTitle();

6
src/widget/year/combo.year.js

@ -22,7 +22,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
this.trigger = BI.createWidget({
type: "bi.year_trigger",
min: o.min,
max: o.max
max: o.max,
value: o.value || ""
});
this.trigger.on(BI.YearTrigger.EVENT_FOCUS, function () {
self.storeValue = this.getKey();
@ -74,7 +75,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
behaviors: o.behaviors,
min: o.min,
max: o.max
}
},
value: o.value || ""
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {

6
src/widget/year/popup.year.js

@ -35,7 +35,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
_init: function () {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.selectedYear = this._year = Date.getDate().getFullYear();
@ -82,6 +82,10 @@ BI.YearPopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.YearPopup.EVENT_CHANGE, self.selectedYear);
});
if(BI.isKey(o.value)){
this.setValue(o.value);
}
},
getValue: function () {

3
src/widget/year/trigger.year.js

@ -37,7 +37,8 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true,
errorText: c.errorText
errorText: c.errorText,
value: o.value
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.YearTrigger.EVENT_FOCUS);

8
src/widget/yearmonth/combo.yearmonth.js

@ -17,14 +17,18 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
BI.YearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.month = BI.createWidget({
type: "bi.month_combo",
behaviors: o.monthBehaviors
behaviors: o.monthBehaviors,
value: o.value.month
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {

8
src/widget/yearquarter/combo.yearquarter.js

@ -17,14 +17,18 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
BI.YearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.quarter = BI.createWidget({
type: "bi.quarter_combo",
behaviors: o.quarterBehaviors
behaviors: o.quarterBehaviors,
value: o.value.quarter
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {

Loading…
Cancel
Save