Browse Source

抽一下公共方法

es6
windy 5 years ago
parent
commit
88f978aee3
  1. 26
      dist/2.0/fineui.ie.js
  2. 26
      dist/2.0/fineui.js
  3. 26
      dist/bundle.ie.js
  4. 26
      dist/bundle.js
  5. 26
      dist/fineui.ie.js
  6. 26
      dist/fineui.js
  7. 26
      dist/fineui_without_jquery_polyfill.js
  8. 26
      dist/widget.js
  9. 23
      src/widget/dynamicdate/__test__/dynamicdate.combo.test.js
  10. 13
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js
  11. 13
      src/widget/multilayersingletree/multilayersingletree.trigger.js

26
dist/2.0/fineui.ie.js vendored

@ -69129,9 +69129,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -69238,6 +69236,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -69319,7 +69324,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData(items);
}, },
setValue: function (v) { setValue: function (v) {
@ -70305,9 +70310,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -70414,6 +70417,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -70496,7 +70506,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData();
}, },
setValue: function (v) { setValue: function (v) {

26
dist/2.0/fineui.js vendored

@ -69533,9 +69533,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -69642,6 +69640,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -69723,7 +69728,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData(items);
}, },
setValue: function (v) { setValue: function (v) {
@ -70709,9 +70714,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -70818,6 +70821,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -70900,7 +70910,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData();
}, },
setValue: function (v) { setValue: function (v) {

26
dist/bundle.ie.js vendored

@ -69129,9 +69129,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -69238,6 +69236,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -69319,7 +69324,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData(items);
}, },
setValue: function (v) { setValue: function (v) {
@ -70305,9 +70310,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -70414,6 +70417,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -70496,7 +70506,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData();
}, },
setValue: function (v) { setValue: function (v) {

26
dist/bundle.js vendored

@ -69533,9 +69533,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -69642,6 +69640,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -69723,7 +69728,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData(items);
}, },
setValue: function (v) { setValue: function (v) {
@ -70709,9 +70714,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -70818,6 +70821,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -70900,7 +70910,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData();
}, },
setValue: function (v) { setValue: function (v) {

26
dist/fineui.ie.js vendored

@ -69374,9 +69374,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -69483,6 +69481,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -69564,7 +69569,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData(items);
}, },
setValue: function (v) { setValue: function (v) {
@ -70550,9 +70555,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -70659,6 +70662,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -70741,7 +70751,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData();
}, },
setValue: function (v) { setValue: function (v) {

26
dist/fineui.js vendored

@ -69778,9 +69778,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -69887,6 +69885,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -69968,7 +69973,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData(items);
}, },
setValue: function (v) { setValue: function (v) {
@ -70954,9 +70959,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -71063,6 +71066,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -71145,7 +71155,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData();
}, },
setValue: function (v) { setValue: function (v) {

26
dist/fineui_without_jquery_polyfill.js vendored

@ -52077,9 +52077,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -52186,6 +52184,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -52267,7 +52272,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData(items);
}, },
setValue: function (v) { setValue: function (v) {
@ -53253,9 +53258,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -53362,6 +53365,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -53444,7 +53454,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData();
}, },
setValue: function (v) { setValue: function (v) {

26
dist/widget.js vendored

@ -7187,9 +7187,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -7296,6 +7294,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -7377,7 +7382,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData(items);
}, },
setValue: function (v) { setValue: function (v) {
@ -8363,9 +8368,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -8472,6 +8475,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -8554,7 +8564,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData();
}, },
setValue: function (v) { setValue: function (v) {

23
src/widget/dynamicdate/__test__/dynamicdate.combo.test.js

@ -82,6 +82,29 @@ describe("DateCombo", function () {
}); });
/**
* test_author_windy
*/
it("下拉后直接点击外部的触发的confirm", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_combo",
width: 220,
height: 30
});
// 点击日期,是否收起下拉
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click();
BI.nextTick(function () {
BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-trigger .bi-input"), null, BI.KeyCode.ENTER, function () {
BI.delay(function () {
expect(dateCombo.element.find(".bi-date-trigger + .bi-popup-view").css("display")).to.equal("none");
dateCombo.destroy();
done();
}, 300);
});
})
});
/** /**
* test_author_windy * test_author_windy

13
src/widget/multilayerselecttree/multilayerselecttree.trigger.js

@ -19,9 +19,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -128,6 +126,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -209,7 +214,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData(items);
}, },
setValue: function (v) { setValue: function (v) {

13
src/widget/multilayersingletree/multilayersingletree.trigger.js

@ -19,9 +19,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this._initData();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -128,6 +126,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) { _getSearchItems: function(keyword) {
var o = this.options; var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -210,7 +215,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) { populate: function (items) {
this.options.items = items; this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); this._initData();
}, },
setValue: function (v) { setValue: function (v) {

Loading…
Cancel
Save