Browse Source

BI-10086 single_select_combo支持默认value

master
windy 7 years ago
parent
commit
8419243920
  1. 3
      demo/js/widget/singleselct/demo.single_select_combo.js
  2. 14
      dist/_fineui.min.js
  3. 38
      dist/bundle.js
  4. 14
      dist/bundle.min.js
  5. 1
      dist/case.js
  6. 3
      dist/demo.js
  7. 14
      dist/fineui.min.js
  8. 37
      dist/widget.js
  9. 1
      src/case/richeditor/richeditor.js
  10. 1
      src/widget/singleselect/search/singleselect.search.loader.js
  11. 3
      src/widget/singleselect/search/singleselect.search.pane.js
  12. 8
      src/widget/singleselect/singleselect.combo.js
  13. 3
      src/widget/singleselect/singleselect.list.js
  14. 3
      src/widget/singleselect/singleselect.loader.js
  15. 6
      src/widget/singleselect/singleselect.popup.view.js
  16. 3
      src/widget/singleselect/singleselect.trigger.js
  17. 3
      src/widget/singleselect/trigger/editor.singleselect.js
  18. 7
      src/widget/singleselect/trigger/searcher.singleselect.js

3
demo/js/widget/singleselct/demo.single_select_combo.js

@ -14,7 +14,8 @@ Demo.SingleSelectCombo = BI.inherit(BI.Widget, {
width: 200,
ref: function () {
self.SingleSelectCombo = this;
}
},
value: "柳州市针织总厂"
});
widget.on(BI.SingleSelectCombo.EVENT_CONFIRM, function () {

14
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

38
dist/bundle.js vendored

@ -83117,6 +83117,7 @@ BI.RichEditor = BI.inherit(BI.Widget, {
});
BI.RichEditor.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.RichEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.RichEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.shortcut("bi.rich_editor", BI.RichEditor);/**
* 分段控件使用的button
*
@ -102113,6 +102114,7 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
logic: {
dynamic: false
},
value: opts.value,
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {
@ -102285,7 +102287,8 @@ BI.SingleSelectSearchPane = BI.inherit(BI.Widget, {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
}
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -102361,7 +102364,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
BI.isKey(self._startValue) && (self.storeValue = self._startValue);
self.trigger.getSearcher().setState(self.storeValue);
};
this.storeValue = "";
this.storeValue = o.value || "";
// 标记正在请求数据
this.requesting = false;
@ -102386,7 +102389,8 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: this.storeValue
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_START, function () {
@ -102482,7 +102486,8 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
},
value: o.value
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
@ -102725,7 +102730,8 @@ BI.SingleSelectList = BI.inherit(BI.Widget, {
});
},
onLoaded: o.onLoaded,
hasNext: o.hasNext
hasNext: o.hasNext,
value: o.value
});
this.list.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
@ -102904,7 +102910,8 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
},
hasNext: function () {
return hasNext;
}
},
value: this.storeValue
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -102997,7 +103004,8 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, {
type: "bi.single_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
@ -103008,7 +103016,8 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, {
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {
@ -103099,7 +103108,8 @@ BI.SingleSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
popup: {},
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_START);
@ -103192,7 +103202,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true
allowBlank: true,
value: o.value
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
@ -103295,7 +103306,8 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
op.keyword = self.editor.getValue();
this.setKeyword(op.keyword);
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -103320,6 +103332,10 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
var keywords = this.getKeywords();
self.fireEvent(BI.SingleSelectSearcher.EVENT_SEARCHING, keywords);
});
if(BI.isNotNull(o.value)){
this.setState(o.value);
}
},
adjustView: function () {

14
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

1
dist/case.js vendored

@ -11175,6 +11175,7 @@ BI.RichEditor = BI.inherit(BI.Widget, {
});
BI.RichEditor.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.RichEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.RichEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.shortcut("bi.rich_editor", BI.RichEditor);/**
* 分段控件使用的button
*

3
dist/demo.js vendored

@ -13124,7 +13124,8 @@ Demo.SingleSelectCombo = BI.inherit(BI.Widget, {
width: 200,
ref: function () {
self.SingleSelectCombo = this;
}
},
value: "柳州市针织总厂"
});
widget.on(BI.SingleSelectCombo.EVENT_CONFIRM, function () {

14
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

37
dist/widget.js vendored

@ -15604,6 +15604,7 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
logic: {
dynamic: false
},
value: opts.value,
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {
@ -15776,7 +15777,8 @@ BI.SingleSelectSearchPane = BI.inherit(BI.Widget, {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
}
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -15852,7 +15854,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
BI.isKey(self._startValue) && (self.storeValue = self._startValue);
self.trigger.getSearcher().setState(self.storeValue);
};
this.storeValue = "";
this.storeValue = o.value || "";
// 标记正在请求数据
this.requesting = false;
@ -15877,7 +15879,8 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: this.storeValue
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_START, function () {
@ -15973,7 +15976,8 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
},
value: o.value
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
@ -16216,7 +16220,8 @@ BI.SingleSelectList = BI.inherit(BI.Widget, {
});
},
onLoaded: o.onLoaded,
hasNext: o.hasNext
hasNext: o.hasNext,
value: o.value
});
this.list.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
@ -16395,7 +16400,8 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
},
hasNext: function () {
return hasNext;
}
},
value: this.storeValue
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -16488,7 +16494,8 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, {
type: "bi.single_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
@ -16499,7 +16506,8 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, {
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {
@ -16590,7 +16598,8 @@ BI.SingleSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
popup: {},
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_START);
@ -16683,7 +16692,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true
allowBlank: true,
value: o.value
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
@ -16786,7 +16796,8 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
op.keyword = self.editor.getValue();
this.setKeyword(op.keyword);
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -16811,6 +16822,10 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
var keywords = this.getKeywords();
self.fireEvent(BI.SingleSelectSearcher.EVENT_SEARCHING, keywords);
});
if(BI.isNotNull(o.value)){
this.setState(o.value);
}
},
adjustView: function () {

1
src/case/richeditor/richeditor.js

@ -73,4 +73,5 @@ BI.RichEditor = BI.inherit(BI.Widget, {
});
BI.RichEditor.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.RichEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.RichEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.shortcut("bi.rich_editor", BI.RichEditor);

1
src/widget/singleselect/search/singleselect.search.loader.js

@ -27,6 +27,7 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
logic: {
dynamic: false
},
value: opts.value,
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {

3
src/widget/singleselect/search/singleselect.search.pane.js

@ -43,7 +43,8 @@ BI.SingleSelectSearchPane = BI.inherit(BI.Widget, {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
}
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);

8
src/widget/singleselect/singleselect.combo.js

@ -22,7 +22,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
BI.isKey(self._startValue) && (self.storeValue = self._startValue);
self.trigger.getSearcher().setState(self.storeValue);
};
this.storeValue = "";
this.storeValue = o.value || "";
// 标记正在请求数据
this.requesting = false;
@ -47,7 +47,8 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: this.storeValue
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_START, function () {
@ -143,7 +144,8 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
},
value: o.value
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {

3
src/widget/singleselect/singleselect.list.js

@ -36,7 +36,8 @@ BI.SingleSelectList = BI.inherit(BI.Widget, {
});
},
onLoaded: o.onLoaded,
hasNext: o.hasNext
hasNext: o.hasNext,
value: o.value
});
this.list.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {

3
src/widget/singleselect/singleselect.loader.js

@ -83,7 +83,8 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
},
hasNext: function () {
return hasNext;
}
},
value: this.storeValue
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);

6
src/widget/singleselect/singleselect.popup.view.js

@ -25,7 +25,8 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, {
type: "bi.single_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
@ -36,7 +37,8 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, {
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {

3
src/widget/singleselect/singleselect.trigger.js

@ -41,7 +41,8 @@ BI.SingleSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
popup: {},
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_START);

3
src/widget/singleselect/trigger/editor.singleselect.js

@ -25,7 +25,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true
allowBlank: true,
value: o.value
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {

7
src/widget/singleselect/trigger/searcher.singleselect.js

@ -47,7 +47,8 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
op.keyword = self.editor.getValue();
this.setKeyword(op.keyword);
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -72,6 +73,10 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
var keywords = this.getKeywords();
self.fireEvent(BI.SingleSelectSearcher.EVENT_SEARCHING, keywords);
});
if(BI.isNotNull(o.value)){
this.setState(o.value);
}
},
adjustView: function () {

Loading…
Cancel
Save