Browse Source

widget中的控件支持value

es6
windy 7 years ago
parent
commit
7e19cd2263
  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. 95
      dist/bundle.js
  12. 15
      dist/case.js
  13. 340
      dist/demo.js
  14. 112
      dist/fineui.js
  15. 80
      dist/widget.js
  16. 5
      src/case/combo/icontextvaluecombo/combo.icontextvalue.js
  17. 5
      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",

95
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,
@ -68009,15 +68008,14 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
width: 100,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
value: "",
el: {}
value: ""
});
},
_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,
@ -68215,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,
@ -78837,6 +78834,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;
@ -79113,6 +79111,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
this.setValue(o.selectedTime);
},
@ -82850,7 +82849,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) {
@ -82878,7 +82878,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());
@ -82976,7 +82977,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) {
@ -83081,6 +83083,7 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
if(BI.isNotNull(v)) {
@ -83281,11 +83284,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()) {
@ -83339,7 +83343,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();
@ -83433,6 +83438,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.comboWrapper = _ref;
}
});
this._checkDynamicValue(opts.value);
},
_checkDynamicValue: function (v) {
@ -83830,6 +83837,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) {
@ -89602,6 +89610,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 () {
@ -91094,7 +91104,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 () {
@ -91121,7 +91132,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 () {
@ -91179,7 +91191,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],
@ -91210,7 +91222,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) {
@ -91317,6 +91330,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
@ -97048,11 +97062,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,
@ -97093,10 +97108,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();
@ -97240,7 +97256,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();
@ -97292,7 +97309,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 () {
@ -97355,7 +97373,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();
@ -97402,6 +97420,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 () {
@ -97462,7 +97484,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);
@ -97546,14 +97569,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 () {
@ -97613,14 +97640,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 () {

15
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,
@ -5672,15 +5671,14 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
width: 100,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
value: "",
el: {}
value: ""
});
},
_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,
@ -5878,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",

112
dist/fineui.js vendored

@ -27351,11 +27351,11 @@ Data.Source = BISource = {
}
this._parent = Model.target;
var state = _.isFunction(this.state) ? this.state() : this.state;
var computed = _.isFunction(this.computed) ? this.computed() : this.computed;
var context = _.isFunction(this.context) ? this.context() : this.context;
var childContext = _.isFunction(this.childContext) ? this.childContext() : this.childContext;
var watch$$1 = _.isFunction(this.watch) ? this.watch() : this.watch;
var actions = _.isFunction(this.actions) ? this.actions() : this.actions;
var computed = this.computed;
var context = this.context;
var childContext = this.childContext;
var watch$$1 = this.watch;
var actions = this.actions;
var keys = _.keys(this.$$model).concat(_.keys(state)).concat(_.keys(computed)).concat(context || []);
defineProps(this, keys);
childContext && defineContext(this, childContext);
@ -27392,13 +27392,6 @@ Data.Source = BISource = {
return Model;
}();
Model.prototype.state = {};
Model.prototype.computed = {};
Model.prototype.context = [];
Model.prototype.childContext = [];
Model.prototype.watch = {};
Model.prototype.actions = {};
function toJSON(model) {
var result = void 0;
if (_.isArray(model)) {
@ -69540,15 +69533,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,
@ -69738,15 +69730,14 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
width: 100,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
value: "",
el: {}
value: ""
});
},
_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,
@ -69944,15 +69935,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,
@ -80566,6 +80556,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;
@ -80842,6 +80833,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
this.setValue(o.selectedTime);
},
@ -84579,7 +84571,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) {
@ -84607,7 +84600,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());
@ -84705,7 +84699,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) {
@ -84810,6 +84805,7 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
if(BI.isNotNull(v)) {
@ -85010,11 +85006,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()) {
@ -85068,7 +85065,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();
@ -85162,6 +85160,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.comboWrapper = _ref;
}
});
this._checkDynamicValue(opts.value);
},
_checkDynamicValue: function (v) {
@ -85559,6 +85559,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) {
@ -91331,6 +91332,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 () {
@ -92823,7 +92826,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 () {
@ -92850,7 +92854,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 () {
@ -92908,7 +92913,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],
@ -92939,7 +92944,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) {
@ -93046,6 +93052,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
@ -98777,11 +98784,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,
@ -98822,10 +98830,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();
@ -98969,7 +98978,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();
@ -99021,7 +99031,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 () {
@ -99084,7 +99095,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();
@ -99131,6 +99142,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 () {
@ -99191,7 +99206,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);
@ -99275,14 +99291,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 () {
@ -99342,14 +99362,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,

5
src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js

@ -10,15 +10,14 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
width: 100,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
value: "",
el: {}
value: ""
});
},
_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