From ab5232d516519913b4f06a8b0925f7a9e553d658 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 19 May 2017 10:39:35 +0800 Subject: [PATCH 1/3] bug --- bi/base.js | 27 ++++----------------------- docs/base.js | 27 ++++----------------------- src/base/collection/collection.js | 3 ++- src/base/grid/grid.js | 3 ++- src/base/table/table.collection.js | 8 -------- src/base/table/table.grid.js | 13 ------------- 6 files changed, 12 insertions(+), 69 deletions(-) diff --git a/bi/base.js b/bi/base.js index 005c9fea9..4eb577a97 100644 --- a/bi/base.js +++ b/bi/base.js @@ -2777,6 +2777,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { _populate: function (items) { var o = this.options; + this._reRange(); if (items && items !== this.options.items) { this.options.items = items; this._calculateSizeAndPositionData(); @@ -2850,7 +2851,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { }, //重新计算children - reRange: function () { + _reRange: function () { this.renderRange = {}; }, @@ -14873,6 +14874,7 @@ BI.GridView = BI.inherit(BI.Widget, { _populate: function (items) { var self = this, o = this.options; + this._reRange(); if (items && items !== this.options.items) { this.options.items = items; } @@ -14961,7 +14963,7 @@ BI.GridView = BI.inherit(BI.Widget, { }, //重新计算children - reRange: function () { + _reRange: function () { this.renderRange = {}; }, @@ -28993,7 +28995,6 @@ BI.CollectionTable = BI.inherit(BI.Widget, { return; } if (this._isNeedDigest === true) { - this._reRange(); this._digest(); } this._isNeedDigest = false; @@ -29091,13 +29092,6 @@ BI.CollectionTable = BI.inherit(BI.Widget, { this.bottomRightCollection.restore(); }, - _reRange: function () { - this.topLeftCollection.reRange(); - this.topRightCollection.reRange(); - this.bottomLeftCollection.reRange(); - this.bottomRightCollection.reRange(); - }, - restore: function () { this._restore(); } @@ -29710,10 +29704,6 @@ BI.GridTable = BI.inherit(BI.Widget, { if (this._width <= 0 || this._height <= 0) { return; } - if (this._isNeedDigest === true) { - this._reRange(); - this._isNeedDigest = false; - } this._populateTable(); this._populateScrollbar(); }, @@ -29789,13 +29779,11 @@ BI.GridTable = BI.inherit(BI.Widget, { populate: function (items, header) { if (items && this.options.items !== items) { - this._isNeedDigest = true; this.options.items = items; this.items = this._getItems(); this._restore(); } if (header && this.options.header !== header) { - this._isNeedDigest = true; this.options.header = header; this.header = this._getHeader(); this._restore(); @@ -29810,13 +29798,6 @@ BI.GridTable = BI.inherit(BI.Widget, { this.bottomRightGrid.restore(); }, - _reRange: function () { - this.topLeftGrid.reRange(); - this.topRightGrid.reRange(); - this.bottomLeftGrid.reRange(); - this.bottomRightGrid.reRange(); - }, - restore: function () { this._restore(); } diff --git a/docs/base.js b/docs/base.js index 005c9fea9..4eb577a97 100644 --- a/docs/base.js +++ b/docs/base.js @@ -2777,6 +2777,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { _populate: function (items) { var o = this.options; + this._reRange(); if (items && items !== this.options.items) { this.options.items = items; this._calculateSizeAndPositionData(); @@ -2850,7 +2851,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { }, //重新计算children - reRange: function () { + _reRange: function () { this.renderRange = {}; }, @@ -14873,6 +14874,7 @@ BI.GridView = BI.inherit(BI.Widget, { _populate: function (items) { var self = this, o = this.options; + this._reRange(); if (items && items !== this.options.items) { this.options.items = items; } @@ -14961,7 +14963,7 @@ BI.GridView = BI.inherit(BI.Widget, { }, //重新计算children - reRange: function () { + _reRange: function () { this.renderRange = {}; }, @@ -28993,7 +28995,6 @@ BI.CollectionTable = BI.inherit(BI.Widget, { return; } if (this._isNeedDigest === true) { - this._reRange(); this._digest(); } this._isNeedDigest = false; @@ -29091,13 +29092,6 @@ BI.CollectionTable = BI.inherit(BI.Widget, { this.bottomRightCollection.restore(); }, - _reRange: function () { - this.topLeftCollection.reRange(); - this.topRightCollection.reRange(); - this.bottomLeftCollection.reRange(); - this.bottomRightCollection.reRange(); - }, - restore: function () { this._restore(); } @@ -29710,10 +29704,6 @@ BI.GridTable = BI.inherit(BI.Widget, { if (this._width <= 0 || this._height <= 0) { return; } - if (this._isNeedDigest === true) { - this._reRange(); - this._isNeedDigest = false; - } this._populateTable(); this._populateScrollbar(); }, @@ -29789,13 +29779,11 @@ BI.GridTable = BI.inherit(BI.Widget, { populate: function (items, header) { if (items && this.options.items !== items) { - this._isNeedDigest = true; this.options.items = items; this.items = this._getItems(); this._restore(); } if (header && this.options.header !== header) { - this._isNeedDigest = true; this.options.header = header; this.header = this._getHeader(); this._restore(); @@ -29810,13 +29798,6 @@ BI.GridTable = BI.inherit(BI.Widget, { this.bottomRightGrid.restore(); }, - _reRange: function () { - this.topLeftGrid.reRange(); - this.topRightGrid.reRange(); - this.bottomLeftGrid.reRange(); - this.bottomRightGrid.reRange(); - }, - restore: function () { this._restore(); } diff --git a/src/base/collection/collection.js b/src/base/collection/collection.js index 1b0320187..d359668a5 100644 --- a/src/base/collection/collection.js +++ b/src/base/collection/collection.js @@ -267,6 +267,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { _populate: function (items) { var o = this.options; + this._reRange(); if (items && items !== this.options.items) { this.options.items = items; this._calculateSizeAndPositionData(); @@ -340,7 +341,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { }, //重新计算children - reRange: function () { + _reRange: function () { this.renderRange = {}; }, diff --git a/src/base/grid/grid.js b/src/base/grid/grid.js index 92798e55b..c76f354c7 100644 --- a/src/base/grid/grid.js +++ b/src/base/grid/grid.js @@ -223,6 +223,7 @@ BI.GridView = BI.inherit(BI.Widget, { _populate: function (items) { var self = this, o = this.options; + this._reRange(); if (items && items !== this.options.items) { this.options.items = items; } @@ -311,7 +312,7 @@ BI.GridView = BI.inherit(BI.Widget, { }, //重新计算children - reRange: function () { + _reRange: function () { this.renderRange = {}; }, diff --git a/src/base/table/table.collection.js b/src/base/table/table.collection.js index dd31c1cc0..63da1b991 100644 --- a/src/base/table/table.collection.js +++ b/src/base/table/table.collection.js @@ -429,7 +429,6 @@ BI.CollectionTable = BI.inherit(BI.Widget, { return; } if (this._isNeedDigest === true) { - this._reRange(); this._digest(); } this._isNeedDigest = false; @@ -527,13 +526,6 @@ BI.CollectionTable = BI.inherit(BI.Widget, { this.bottomRightCollection.restore(); }, - _reRange: function () { - this.topLeftCollection.reRange(); - this.topRightCollection.reRange(); - this.bottomLeftCollection.reRange(); - this.bottomRightCollection.reRange(); - }, - restore: function () { this._restore(); } diff --git a/src/base/table/table.grid.js b/src/base/table/table.grid.js index 074647924..7454fafd2 100644 --- a/src/base/table/table.grid.js +++ b/src/base/table/table.grid.js @@ -357,10 +357,6 @@ BI.GridTable = BI.inherit(BI.Widget, { if (this._width <= 0 || this._height <= 0) { return; } - if (this._isNeedDigest === true) { - this._reRange(); - this._isNeedDigest = false; - } this._populateTable(); this._populateScrollbar(); }, @@ -436,13 +432,11 @@ BI.GridTable = BI.inherit(BI.Widget, { populate: function (items, header) { if (items && this.options.items !== items) { - this._isNeedDigest = true; this.options.items = items; this.items = this._getItems(); this._restore(); } if (header && this.options.header !== header) { - this._isNeedDigest = true; this.options.header = header; this.header = this._getHeader(); this._restore(); @@ -457,13 +451,6 @@ BI.GridTable = BI.inherit(BI.Widget, { this.bottomRightGrid.restore(); }, - _reRange: function () { - this.topLeftGrid.reRange(); - this.topRightGrid.reRange(); - this.bottomLeftGrid.reRange(); - this.bottomRightGrid.reRange(); - }, - restore: function () { this._restore(); } From 8d68ba157fef7ec842a2d362a069bb9f5e02b21f Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 19 May 2017 11:26:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?button=E7=9A=84doClick?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bi/base.js | 21 ++++++++++++++------- docs/base.js | 21 ++++++++++++++------- src/base/single/button/button.basic.js | 21 ++++++++++++++------- 3 files changed, 42 insertions(+), 21 deletions(-) diff --git a/bi/base.js b/bi/base.js index 005c9fea9..1035905ee 100644 --- a/bi/base.js +++ b/bi/base.js @@ -781,7 +781,7 @@ BI.BasicButton = BI.inherit(BI.Single, { }); //之后的300ms点击无效 - var onClick = BI.debounce(this.doClick, BI.EVENT_RESPONSE_TIME, true); + var onClick = BI.debounce(this._doClick, BI.EVENT_RESPONSE_TIME, true); function ev(e) { if (o.stopEvent) { @@ -803,6 +803,11 @@ BI.BasicButton = BI.inherit(BI.Single, { _trigger: function () { var o = this.options; + if (!this.isDisableSelected()) { + this.isForceSelected() ? this.setSelected(true) : + (this.isForceNotSelected() ? this.setSelected(false) : + this.setSelected(!this.isSelected())); + } if (this.isValid()) { o.handler.call(this, this.getValue(), this); var v = this.getValue(); @@ -811,13 +816,15 @@ BI.BasicButton = BI.inherit(BI.Single, { } }, - doClick: function () { - if (!this.isDisableSelected()) { - this.isForceSelected() ? this.setSelected(true) : - (this.isForceNotSelected() ? this.setSelected(false) : - this.setSelected(!this.isSelected())); - } + _doClick: function () { this._trigger(); + if (this.isValid()) { + this.doClick(); + } + }, + + doClick: function () { + }, handle: function () { diff --git a/docs/base.js b/docs/base.js index 005c9fea9..1035905ee 100644 --- a/docs/base.js +++ b/docs/base.js @@ -781,7 +781,7 @@ BI.BasicButton = BI.inherit(BI.Single, { }); //之后的300ms点击无效 - var onClick = BI.debounce(this.doClick, BI.EVENT_RESPONSE_TIME, true); + var onClick = BI.debounce(this._doClick, BI.EVENT_RESPONSE_TIME, true); function ev(e) { if (o.stopEvent) { @@ -803,6 +803,11 @@ BI.BasicButton = BI.inherit(BI.Single, { _trigger: function () { var o = this.options; + if (!this.isDisableSelected()) { + this.isForceSelected() ? this.setSelected(true) : + (this.isForceNotSelected() ? this.setSelected(false) : + this.setSelected(!this.isSelected())); + } if (this.isValid()) { o.handler.call(this, this.getValue(), this); var v = this.getValue(); @@ -811,13 +816,15 @@ BI.BasicButton = BI.inherit(BI.Single, { } }, - doClick: function () { - if (!this.isDisableSelected()) { - this.isForceSelected() ? this.setSelected(true) : - (this.isForceNotSelected() ? this.setSelected(false) : - this.setSelected(!this.isSelected())); - } + _doClick: function () { this._trigger(); + if (this.isValid()) { + this.doClick(); + } + }, + + doClick: function () { + }, handle: function () { diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index 80b513862..8e1079af0 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -198,7 +198,7 @@ BI.BasicButton = BI.inherit(BI.Single, { }); //之后的300ms点击无效 - var onClick = BI.debounce(this.doClick, BI.EVENT_RESPONSE_TIME, true); + var onClick = BI.debounce(this._doClick, BI.EVENT_RESPONSE_TIME, true); function ev(e) { if (o.stopEvent) { @@ -220,6 +220,11 @@ BI.BasicButton = BI.inherit(BI.Single, { _trigger: function () { var o = this.options; + if (!this.isDisableSelected()) { + this.isForceSelected() ? this.setSelected(true) : + (this.isForceNotSelected() ? this.setSelected(false) : + this.setSelected(!this.isSelected())); + } if (this.isValid()) { o.handler.call(this, this.getValue(), this); var v = this.getValue(); @@ -228,13 +233,15 @@ BI.BasicButton = BI.inherit(BI.Single, { } }, - doClick: function () { - if (!this.isDisableSelected()) { - this.isForceSelected() ? this.setSelected(true) : - (this.isForceNotSelected() ? this.setSelected(false) : - this.setSelected(!this.isSelected())); - } + _doClick: function () { this._trigger(); + if (this.isValid()) { + this.doClick(); + } + }, + + doClick: function () { + }, handle: function () { From aa133f3f06b375d84fac6c189220d00332aac5e9 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 19 May 2017 16:06:00 +0800 Subject: [PATCH 3/3] add --- Gruntfile.js | 4 +- bi/base.js | 34 +- bi/case.js | 4 + bi/polyfill.js | 4 +- bi/widget.js | 433 +++++++++--------- demo/js/config/base.js | 2 +- docs/base.js | 34 +- docs/case.js | 4 + docs/demo.js | 2 +- docs/polyfill.js | 4 +- docs/widget.js | 433 +++++++++--------- src/base/tree/{synctree.js => asynctree.js} | 20 +- src/base/tree/parttree.js | 8 +- src/base/tree/treeview.js | 6 + src/case/pager/pager.all.count.js | 4 + .../multistringlist/multistringlist.less | 4 +- src/polyfill/array.js | 4 +- .../multiselectlist.js} | 26 +- .../multiselecttree.js} | 2 +- .../multiselecttree.popup.js} | 4 +- src/widget/multitree/multi.tree.popup.js | 2 +- .../sequencetable/listnumber.sequencetable.js | 1 + 22 files changed, 536 insertions(+), 503 deletions(-) rename src/base/tree/{synctree.js => asynctree.js} (91%) rename src/widget/{multistringlist/multistringlist.js => multiselectlist/multiselectlist.js} (93%) rename src/widget/{multitreelist/multitreelist.js => multiselecttree/multiselecttree.js} (97%) rename src/widget/{multitreelist/multitreelist.popup.js => multiselecttree/multiselecttree.popup.js} (91%) diff --git a/Gruntfile.js b/Gruntfile.js index ce4ad486c..1f1f46d42 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -49,7 +49,7 @@ module.exports = function (grunt) { 'src/base/combination/tree.button.js', 'src/base/combination/map.button.js', 'src/base/tree/treeview.js', - 'src/base/tree/synctree.js', + 'src/base/tree/asynctree.js', 'src/base/tree/parttree.js', 'src/base/**/*.js' ], @@ -162,7 +162,7 @@ module.exports = function (grunt) { 'src/base/combination/tree.button.js', 'src/base/combination/map.button.js', 'src/base/tree/treeview.js', - 'src/base/tree/synctree.js', + 'src/base/tree/asynctree.js', 'src/base/tree/parttree.js', 'src/base/**/*.js' ], diff --git a/bi/base.js b/bi/base.js index 4eb577a97..cf65357ad 100644 --- a/bi/base.js +++ b/bi/base.js @@ -1956,6 +1956,12 @@ BI.TreeView = BI.inherit(BI.Pane, { }); }, + getExpandedValue: function(){ + if (!this.nodes) { + return null; + } + }, + refresh: function () { this.nodes && this.nodes.refresh(); }, @@ -1991,15 +1997,15 @@ BI.TreeView.EVENT_AFTERINIT = BI.Events.AFTERINIT; BI.shortcut("bi.tree_view", BI.TreeView);/** * guy * 同步树 - * @class BI.SyncTree + * @class BI.AsyncTree * @extends BI.TreeView */ -BI.SyncTree = BI.inherit(BI.TreeView, { +BI.AsyncTree = BI.inherit(BI.TreeView, { _defaultConfig: function () { - return BI.extend(BI.SyncTree.superclass._defaultConfig.apply(this, arguments), {}) + return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {}) }, _init: function () { - BI.SyncTree.superclass._init.apply(this, arguments); + BI.AsyncTree.superclass._init.apply(this, arguments); }, //配置属性 @@ -2069,7 +2075,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, { } function beforeExpand(treeId, treeNode) { - self._expandNode(treeId, treeNode); + self._beforeExpandNode(treeId, treeNode); } function onCheck(event, treeId, treeNode) { @@ -2090,7 +2096,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, { _selectTreeNode: function (treeId, treeNode) { var self = this, o = this.options; var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); - var name = this._getNodeValue(treeNode) + var name = this._getNodeValue(treeNode); // var values = parentValues.concat([name]); if (treeNode.checked === true) { } else { @@ -2109,11 +2115,11 @@ BI.SyncTree = BI.inherit(BI.TreeView, { } } } - BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); + BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments); }, //展开节点 - _expandNode: function (treeId, treeNode) { + _beforeExpandNode: function (treeId, treeNode) { var self = this, o = this.options; var parentValues = treeNode.parentValues || self._getParentValues(treeNode); var op = BI.extend({}, o.paras, { @@ -2168,7 +2174,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, { }, hasChecked: function () { - return !BI.isEmpty(this.selectedValues) || BI.SyncTree.superclass.hasChecked.apply(this, arguments); + return !BI.isEmpty(this.selectedValues) || BI.AsyncTree.superclass.hasChecked.apply(this, arguments); }, getValue: function () { @@ -2196,13 +2202,13 @@ BI.SyncTree = BI.inherit(BI.TreeView, { } }); -BI.shortcut("bi.sync_tree", BI.SyncTree);/** +BI.shortcut("bi.async_tree", BI.AsyncTree);/** * guy * 局部树,两个请求树, 第一个请求构造树,第二个请求获取节点 * @class BI.PartTree - * @extends BI.SyncTree + * @extends BI.AsyncTree */ -BI.PartTree = BI.inherit(BI.SyncTree, { +BI.PartTree = BI.inherit(BI.AsyncTree, { _defaultConfig: function () { return BI.extend(BI.PartTree.superclass._defaultConfig.apply(this, arguments), {}) }, @@ -2241,7 +2247,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, { var name = this._getNodeValue(treeNode) // var values = parentValues.concat([name]); if (treeNode.checked === true) { - BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); + BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments); } else { o.itemsCreator(BI.extend({}, o.paras, { type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA, @@ -2266,7 +2272,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, { } } self.selectedValues = new_values; - BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); + BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments); }); } }, diff --git a/bi/case.js b/bi/case.js index 2fcf3869e..2a7f667cd 100644 --- a/bi/case.js +++ b/bi/case.js @@ -7951,6 +7951,10 @@ BI.AllCountPager = BI.inherit(BI.Widget, { this.pager.setValue(v); }, + setVPage: function (v) { + this.pager.setValue(v); + }, + setCount: function (count) { this.rowCount.setText(count); this.rowCount.setTitle(count); diff --git a/bi/polyfill.js b/bi/polyfill.js index 854ed288f..f493c89a5 100644 --- a/bi/polyfill.js +++ b/bi/polyfill.js @@ -4,7 +4,7 @@ if(![].indexOf){ * @param {Object} o 要检查的值 * @return {Number} o在数组中的索引(如果不在数组中则返回-1) */ - [].indexOf = function (o) { + Array.prototype.indexOf = function (o) { for (var i = 0, len = this.length; i < len; i++) { if (_.isEqual(o, this[i])) { return i; @@ -20,7 +20,7 @@ if(![].lastIndexOf){ * @param {Object} o 要检查的值 * @return {Number} o在数组中的索引(如果不在数组中则返回-1) */ - [].lastIndexOf = function (o) { + Array.prototype.lastIndexOf = function (o) { for (var len = this.length, i = len - 1; i >= 0; i--) { if (_.isEqual(o, this[i])) { return i; diff --git a/bi/widget.js b/bi/widget.js index 903504541..55d86a401 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -10957,17 +10957,17 @@ BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW = "MultiSelectCheckSe BI.shortcut('bi.multi_select_check_selected_switcher', BI.MultiSelectCheckSelectedSwitcher);/** * Created by zcf_1 on 2017/5/2. */ -BI.MultiStringList = BI.inherit(BI.Widget, { +BI.MultiSelectList = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.MultiStringList.superclass._defaultConfig.apply(this, arguments), { - baseCls: 'bi-multi-string-list', + return BI.extend(BI.MultiSelectList.superclass._defaultConfig.apply(this, arguments), { + baseCls: 'bi-multi-select-list', itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, el: {} }) }, _init: function () { - BI.MultiStringList.superclass._init.apply(this, arguments); + BI.MultiSelectList.superclass._init.apply(this, arguments); var self = this, o = this.options; this.storeValue = {}; @@ -10978,7 +10978,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { this.adapter = BI.createWidget({ type: "bi.multi_select_loader", - cls: "popup-multi-string-list bi-border-left bi-border-right bi-border-bottom", + cls: "popup-multi-select-list bi-border-left bi-border-right bi-border-bottom", itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, // onLoaded: o.onLoaded, @@ -10990,7 +10990,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { self.storeValue = this.getValue(); self._adjust(function () { assertShowValue(); - self.fireEvent(BI.MultiStringList.EVENT_CHANGE); + self.fireEvent(BI.MultiSelectList.EVENT_CHANGE); }); }); @@ -11049,7 +11049,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { self._setStartValue(keyword); assertShowValue(); self._setStartValue(""); - self.fireEvent(BI.MultiStringList.EVENT_CHANGE); + self.fireEvent(BI.MultiSelectList.EVENT_CHANGE); }) } else { self._showAdapter(); @@ -11150,7 +11150,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { this._assertValue(this.storeValue); if (!this._allData) { o.itemsCreator({ - type: BI.MultiStringList.REQ_GET_ALL_DATA + type: BI.MultiSelectList.REQ_GET_ALL_DATA }, function (ob) { self._allData = BI.pluck(ob.items, "value"); digest(self._allData); @@ -11174,7 +11174,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { var self = this, o = this.options; this._assertValue(res); o.itemsCreator({ - type: BI.MultiStringList.REQ_GET_ALL_DATA, + type: BI.MultiSelectList.REQ_GET_ALL_DATA, keyword: self.trigger.getKeyword() }, function (ob) { var items = BI.pluck(ob.items, "value"); @@ -11211,7 +11211,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { var self = this, o = this.options; if (!this._count) { o.itemsCreator({ - type: BI.MultiStringList.REQ_GET_DATA_LENGTH + type: BI.MultiSelectList.REQ_GET_DATA_LENGTH }, function (res) { self._count = res.count; adjust(); @@ -11294,13 +11294,214 @@ BI.MultiStringList = BI.inherit(BI.Widget, { } }); -BI.extend(BI.MultiStringList, { +BI.extend(BI.MultiSelectList, { REQ_GET_DATA_LENGTH: 0, REQ_GET_ALL_DATA: -1 }); -BI.MultiStringList.EVENT_CHANGE = "BI.MultiStringList.EVENT_CHANGE"; -BI.shortcut("bi.multi_string_list", BI.MultiStringList);/** +BI.MultiSelectList.EVENT_CHANGE = "BI.MultiSelectList.EVENT_CHANGE"; +BI.shortcut("bi.multi_select_list", BI.MultiSelectList);/** + * Created by zcf_1 on 2017/5/11. + */ +BI.MultiSelectTree = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.MultiSelectTree.superclass._defaultConfig.apply(this, arguments), { + baseCls: 'bi-multi-select-tree', + itemsCreator: BI.emptyFn, + height: 25 + }) + }, + + _init: function () { + BI.MultiSelectTree.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.storeValue = {value: {}}; + + this.adapter = BI.createWidget({ + type: "bi.multi_select_tree_popup", + itemsCreator: o.itemsCreator + }); + this.adapter.on(BI.MultiSelectTreePopup.EVENT_CHANGE, function () { + if (self.trigger.isSearching()) { + self.storeValue = {value: self.searcherPane.getValue()}; + } else { + self.storeValue = {value: self.adapter.getValue()}; + } + self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE); + }); + + this.searcherPane = BI.createWidget({//搜索中的时候用的是parttree,同adapter中的synctree不一样 + type: "bi.multi_tree_search_pane", + cls: "bi-border-left bi-border-right bi-border-bottom", + keywordGetter: function () { + return self.trigger.getKeyword(); + }, + itemsCreator: function (op, callback) { + op.keyword = self.trigger.getKeyword(); + o.itemsCreator(op, callback); + } + }); + this.searcherPane.setVisible(false); + + this.trigger = BI.createWidget({ + type: "bi.searcher", + isAutoSearch: false, + isAutoSync: false, + onSearch: function (op, callback) { + callback({ + keyword: self.trigger.getKeyword() + }); + }, + adapter: this.adapter, + popup: this.searcherPane, + height: 200, + masker: false, + listeners: [{ + eventName: BI.Searcher.EVENT_START, + action: function () { + self._showSearcherPane(); + self.storeValue = {value: self.adapter.getValue()}; + self.searcherPane.setValue(self.storeValue); + } + }, { + eventName: BI.Searcher.EVENT_STOP, + action: function () { + self._showAdapter(); + // self.storeValue = {value: self.searcherPane.getValue()}; + self.adapter.setValue(self.storeValue); + BI.nextTick(function () { + self.adapter.populate(); + }); + } + }, { + eventName: BI.Searcher.EVENT_CHANGE, + action: function () { + if (self.trigger.isSearching()) { + self.storeValue = {value: self.searcherPane.getValue()}; + } else { + self.storeValue = {value: self.adapter.getValue()}; + } + self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE); + } + }, { + eventName: BI.Searcher.EVENT_PAUSE, + action: function () { + self._showAdapter(); + } + }] + }); + + BI.createWidget({ + type: "bi.vtape", + element: this, + height: "100%", + width: "100%", + items: [{ + el: this.trigger, + height: 30 + }, { + el: this.adapter, + height: "fill" + }] + }); + BI.createWidget({ + type: "bi.absolute", + element: this, + height: "100%", + width: "100%", + items: [{ + el: this.searcherPane, + top: 30, + bottom: 0, + left: 0, + right: 0 + }] + }) + + }, + + _showAdapter: function () { + this.adapter.setVisible(true); + this.searcherPane.setVisible(false); + }, + + _showSearcherPane: function () { + this.searcherPane.setVisible(true); + this.adapter.setVisible(false); + }, + + resize: function () { + + }, + + setValue: function (v) { + this.storeValue.value = v || {}; + this.adapter.setValue({ + value: v || {} + }); + this.trigger.setValue({ + value: v || {} + }); + }, + + getValue: function () { + return this.storeValue.value; + }, + + populate: function () { + this.trigger.populate.apply(this.trigger, arguments); + this.adapter.populate.apply(this.adapter, arguments); + } +}); +BI.MultiSelectTree.EVENT_CHANGE = "BI.MultiSelectTree.EVENT_CHANGE"; +BI.shortcut("bi.multi_select_tree", BI.MultiSelectTree);/** + * Created by zcf on 2016/12/21. + */ +BI.MultiSelectTreePopup = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.MultiSelectTreePopup.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-multi-select-tree-popup bi-border-left bi-border-right bi-border-bottom", + itemsCreator: BI.emptyFn + }); + }, + _init: function () { + BI.MultiSelectTreePopup.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.popup = BI.createWidget({ + type: "bi.async_tree", + height: 400, + element: this, + itemsCreator: o.itemsCreator + }); + this.popup.on(BI.TreeView.EVENT_AFTERINIT, function () { + self.fireEvent(BI.MultiSelectTreePopup.EVENT_AFTER_INIT) + }); + this.popup.on(BI.TreeView.EVENT_CHANGE, function () { + self.fireEvent(BI.MultiSelectTreePopup.EVENT_CHANGE) + }); + }, + + hasChecked: function () { + return this.popup.hasChecked(); + }, + + getValue: function () { + return this.popup.getValue(); + }, + + setValue: function (v) { + v || (v = {}); + this.popup.setValue(v.value); + }, + + populate: function (config) { + this.popup.stroke(config); + } + +}); +BI.MultiSelectTreePopup.EVENT_AFTER_INIT = "BI.MultiSelectTreePopup.EVENT_AFTER_INIT"; +BI.MultiSelectTreePopup.EVENT_CHANGE = "BI.MultiSelectTreePopup.EVENT_CHANGE"; +BI.shortcut("bi.multi_select_tree_popup", BI.MultiSelectTreePopup);/** * * @class BI.MultiTreeCheckPane * @extends BI.Pane @@ -11695,7 +11896,7 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, { this.selectedValues = {}; this.tree = BI.createWidget({ - type: "bi.sync_tree", + type: "bi.async_tree", height: 400, cls:"popup-view-tree", itemsCreator: opts.itemsCreator, @@ -12039,208 +12240,7 @@ BI.MultiTreeSearcher.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiTreeSearcher.EVENT_START = "EVENT_START"; BI.MultiTreeSearcher.EVENT_STOP = "EVENT_STOP"; BI.MultiTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE"; -BI.shortcut('bi.multi_tree_searcher', BI.MultiTreeSearcher);/** - * Created by zcf_1 on 2017/5/11. - */ -BI.MultiSelectTree = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.MultiSelectTree.superclass._defaultConfig.apply(this, arguments), { - baseCls: 'bi-multi-tree-combo', - itemsCreator: BI.emptyFn, - height: 25 - }) - }, - - _init: function () { - BI.MultiSelectTree.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.storeValue = {value: {}}; - - this.adapter = BI.createWidget({ - type: "bi.multi_select_tree_popup", - itemsCreator: o.itemsCreator - }); - this.adapter.on(BI.MultiSelectTreePopup.EVENT_CHANGE, function () { - if (self.trigger.isSearching()) { - self.storeValue = {value: self.searcherPane.getValue()}; - } else { - self.storeValue = {value: self.adapter.getValue()}; - } - self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE); - }); - - this.searcherPane = BI.createWidget({//搜索中的时候用的是parttree,同adapter中的synctree不一样 - type: "bi.multi_tree_search_pane", - cls: "bi-border-left bi-border-right bi-border-bottom", - keywordGetter: function () { - return self.trigger.getKeyword(); - }, - itemsCreator: function (op, callback) { - op.keyword = self.trigger.getKeyword(); - o.itemsCreator(op, callback); - } - }); - this.searcherPane.setVisible(false); - - this.trigger = BI.createWidget({ - type: "bi.searcher", - isAutoSearch: false, - isAutoSync: false, - onSearch: function (op, callback) { - callback({ - keyword: self.trigger.getKeyword() - }); - }, - adapter: this.adapter, - popup: this.searcherPane, - height: 200, - masker: false, - listeners: [{ - eventName: BI.Searcher.EVENT_START, - action: function () { - self._showSearcherPane(); - self.storeValue = {value: self.adapter.getValue()}; - self.searcherPane.setValue(self.storeValue); - } - }, { - eventName: BI.Searcher.EVENT_STOP, - action: function () { - self._showAdapter(); - // self.storeValue = {value: self.searcherPane.getValue()}; - self.adapter.setValue(self.storeValue); - BI.nextTick(function () { - self.adapter.populate(); - }); - } - }, { - eventName: BI.Searcher.EVENT_CHANGE, - action: function () { - if (self.trigger.isSearching()) { - self.storeValue = {value: self.searcherPane.getValue()}; - } else { - self.storeValue = {value: self.adapter.getValue()}; - } - self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE); - } - }, { - eventName: BI.Searcher.EVENT_PAUSE, - action: function () { - self._showAdapter(); - } - }] - }); - - BI.createWidget({ - type: "bi.vtape", - element: this, - height: "100%", - width: "100%", - items: [{ - el: this.trigger, - height: 30 - }, { - el: this.adapter, - height: "fill" - }] - }); - BI.createWidget({ - type: "bi.absolute", - element: this, - height: "100%", - width: "100%", - items: [{ - el: this.searcherPane, - top: 30, - bottom: 0, - left: 0, - right: 0 - }] - }) - - }, - - _showAdapter: function () { - this.adapter.setVisible(true); - this.searcherPane.setVisible(false); - }, - - _showSearcherPane: function () { - this.searcherPane.setVisible(true); - this.adapter.setVisible(false); - }, - - resize: function () { - - }, - - setValue: function (v) { - this.storeValue.value = v || {}; - this.adapter.setValue({ - value: v || {} - }); - this.trigger.setValue({ - value: v || {} - }); - }, - - getValue: function () { - return this.storeValue.value; - }, - - populate: function () { - this.trigger.populate.apply(this.trigger, arguments); - this.adapter.populate.apply(this.adapter, arguments); - } -}); -BI.MultiSelectTree.EVENT_CHANGE = "BI.MultiSelectTree.EVENT_CHANGE"; -BI.shortcut("bi.multi_select_tree", BI.MultiSelectTree);/** - * Created by zcf on 2016/12/21. - */ -BI.MultiSelectTreePopup = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.MultiSelectTreePopup.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-tree-list-popup bi-border-left bi-border-right bi-border-bottom", - itemsCreator: BI.emptyFn - }); - }, - _init: function () { - BI.MultiSelectTreePopup.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.popup = BI.createWidget({ - type: "bi.sync_tree", - height: 400, - element: this, - itemsCreator: o.itemsCreator - }); - this.popup.on(BI.TreeView.EVENT_AFTERINIT, function () { - self.fireEvent(BI.MultiSelectTreePopup.EVENT_AFTER_INIT) - }); - this.popup.on(BI.TreeView.EVENT_CHANGE, function () { - self.fireEvent(BI.MultiSelectTreePopup.EVENT_CHANGE) - }); - }, - - hasChecked: function () { - return this.popup.hasChecked(); - }, - - getValue: function () { - return this.popup.getValue(); - }, - - setValue: function (v) { - v || (v = {}); - this.popup.setValue(v.value); - }, - - populate: function (config) { - this.popup.stroke(config); - } - -}); -BI.MultiSelectTreePopup.EVENT_AFTER_INIT = "BI.MultiSelectTreePopup.EVENT_AFTER_INIT"; -BI.MultiSelectTreePopup.EVENT_CHANGE = "BI.MultiSelectTreePopup.EVENT_CHANGE"; -BI.shortcut("bi.multi_select_tree_popup", BI.MultiSelectTreePopup);//小于号的值为:0,小于等于号的值为:1 +BI.shortcut('bi.multi_tree_searcher', BI.MultiTreeSearcher);//小于号的值为:0,小于等于号的值为:1 //closeMIn:最小值的符号,closeMax:最大值的符号 /** * Created by roy on 15/9/17. @@ -15964,6 +15964,7 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { }, setVPage: function (v) { + v = v < 1 ? 1 : v; var o = this.options; this.start = (v - 1) * o.pageSize + 1; }, diff --git a/demo/js/config/base.js b/demo/js/config/base.js index 54056d547..f3c020ded 100644 --- a/demo/js/config/base.js +++ b/demo/js/config/base.js @@ -76,7 +76,7 @@ Demo.BASE_CONFIG = [{ value: "demo.tree_view" }, { pId: 203, - text: "bi.sync_tree", + text: "bi.async_tree", value: "demo.sync_tree" }, { pId: 203, diff --git a/docs/base.js b/docs/base.js index 4eb577a97..cf65357ad 100644 --- a/docs/base.js +++ b/docs/base.js @@ -1956,6 +1956,12 @@ BI.TreeView = BI.inherit(BI.Pane, { }); }, + getExpandedValue: function(){ + if (!this.nodes) { + return null; + } + }, + refresh: function () { this.nodes && this.nodes.refresh(); }, @@ -1991,15 +1997,15 @@ BI.TreeView.EVENT_AFTERINIT = BI.Events.AFTERINIT; BI.shortcut("bi.tree_view", BI.TreeView);/** * guy * 同步树 - * @class BI.SyncTree + * @class BI.AsyncTree * @extends BI.TreeView */ -BI.SyncTree = BI.inherit(BI.TreeView, { +BI.AsyncTree = BI.inherit(BI.TreeView, { _defaultConfig: function () { - return BI.extend(BI.SyncTree.superclass._defaultConfig.apply(this, arguments), {}) + return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {}) }, _init: function () { - BI.SyncTree.superclass._init.apply(this, arguments); + BI.AsyncTree.superclass._init.apply(this, arguments); }, //配置属性 @@ -2069,7 +2075,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, { } function beforeExpand(treeId, treeNode) { - self._expandNode(treeId, treeNode); + self._beforeExpandNode(treeId, treeNode); } function onCheck(event, treeId, treeNode) { @@ -2090,7 +2096,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, { _selectTreeNode: function (treeId, treeNode) { var self = this, o = this.options; var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); - var name = this._getNodeValue(treeNode) + var name = this._getNodeValue(treeNode); // var values = parentValues.concat([name]); if (treeNode.checked === true) { } else { @@ -2109,11 +2115,11 @@ BI.SyncTree = BI.inherit(BI.TreeView, { } } } - BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); + BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments); }, //展开节点 - _expandNode: function (treeId, treeNode) { + _beforeExpandNode: function (treeId, treeNode) { var self = this, o = this.options; var parentValues = treeNode.parentValues || self._getParentValues(treeNode); var op = BI.extend({}, o.paras, { @@ -2168,7 +2174,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, { }, hasChecked: function () { - return !BI.isEmpty(this.selectedValues) || BI.SyncTree.superclass.hasChecked.apply(this, arguments); + return !BI.isEmpty(this.selectedValues) || BI.AsyncTree.superclass.hasChecked.apply(this, arguments); }, getValue: function () { @@ -2196,13 +2202,13 @@ BI.SyncTree = BI.inherit(BI.TreeView, { } }); -BI.shortcut("bi.sync_tree", BI.SyncTree);/** +BI.shortcut("bi.async_tree", BI.AsyncTree);/** * guy * 局部树,两个请求树, 第一个请求构造树,第二个请求获取节点 * @class BI.PartTree - * @extends BI.SyncTree + * @extends BI.AsyncTree */ -BI.PartTree = BI.inherit(BI.SyncTree, { +BI.PartTree = BI.inherit(BI.AsyncTree, { _defaultConfig: function () { return BI.extend(BI.PartTree.superclass._defaultConfig.apply(this, arguments), {}) }, @@ -2241,7 +2247,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, { var name = this._getNodeValue(treeNode) // var values = parentValues.concat([name]); if (treeNode.checked === true) { - BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); + BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments); } else { o.itemsCreator(BI.extend({}, o.paras, { type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA, @@ -2266,7 +2272,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, { } } self.selectedValues = new_values; - BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); + BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments); }); } }, diff --git a/docs/case.js b/docs/case.js index 2fcf3869e..2a7f667cd 100644 --- a/docs/case.js +++ b/docs/case.js @@ -7951,6 +7951,10 @@ BI.AllCountPager = BI.inherit(BI.Widget, { this.pager.setValue(v); }, + setVPage: function (v) { + this.pager.setValue(v); + }, + setCount: function (count) { this.rowCount.setText(count); this.rowCount.setTitle(count); diff --git a/docs/demo.js b/docs/demo.js index e7a4a5c0f..f1787c8f1 100644 --- a/docs/demo.js +++ b/docs/demo.js @@ -2755,7 +2755,7 @@ BI.shortcut("demo.value_chooser_combo", Demo.ValueChooserCombo);Demo.BASE_CONFIG value: "demo.tree_view" }, { pId: 203, - text: "bi.sync_tree", + text: "bi.async_tree", value: "demo.sync_tree" }, { pId: 203, diff --git a/docs/polyfill.js b/docs/polyfill.js index 854ed288f..f493c89a5 100644 --- a/docs/polyfill.js +++ b/docs/polyfill.js @@ -4,7 +4,7 @@ if(![].indexOf){ * @param {Object} o 要检查的值 * @return {Number} o在数组中的索引(如果不在数组中则返回-1) */ - [].indexOf = function (o) { + Array.prototype.indexOf = function (o) { for (var i = 0, len = this.length; i < len; i++) { if (_.isEqual(o, this[i])) { return i; @@ -20,7 +20,7 @@ if(![].lastIndexOf){ * @param {Object} o 要检查的值 * @return {Number} o在数组中的索引(如果不在数组中则返回-1) */ - [].lastIndexOf = function (o) { + Array.prototype.lastIndexOf = function (o) { for (var len = this.length, i = len - 1; i >= 0; i--) { if (_.isEqual(o, this[i])) { return i; diff --git a/docs/widget.js b/docs/widget.js index 903504541..55d86a401 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -10957,17 +10957,17 @@ BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW = "MultiSelectCheckSe BI.shortcut('bi.multi_select_check_selected_switcher', BI.MultiSelectCheckSelectedSwitcher);/** * Created by zcf_1 on 2017/5/2. */ -BI.MultiStringList = BI.inherit(BI.Widget, { +BI.MultiSelectList = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.MultiStringList.superclass._defaultConfig.apply(this, arguments), { - baseCls: 'bi-multi-string-list', + return BI.extend(BI.MultiSelectList.superclass._defaultConfig.apply(this, arguments), { + baseCls: 'bi-multi-select-list', itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, el: {} }) }, _init: function () { - BI.MultiStringList.superclass._init.apply(this, arguments); + BI.MultiSelectList.superclass._init.apply(this, arguments); var self = this, o = this.options; this.storeValue = {}; @@ -10978,7 +10978,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { this.adapter = BI.createWidget({ type: "bi.multi_select_loader", - cls: "popup-multi-string-list bi-border-left bi-border-right bi-border-bottom", + cls: "popup-multi-select-list bi-border-left bi-border-right bi-border-bottom", itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, // onLoaded: o.onLoaded, @@ -10990,7 +10990,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { self.storeValue = this.getValue(); self._adjust(function () { assertShowValue(); - self.fireEvent(BI.MultiStringList.EVENT_CHANGE); + self.fireEvent(BI.MultiSelectList.EVENT_CHANGE); }); }); @@ -11049,7 +11049,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { self._setStartValue(keyword); assertShowValue(); self._setStartValue(""); - self.fireEvent(BI.MultiStringList.EVENT_CHANGE); + self.fireEvent(BI.MultiSelectList.EVENT_CHANGE); }) } else { self._showAdapter(); @@ -11150,7 +11150,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { this._assertValue(this.storeValue); if (!this._allData) { o.itemsCreator({ - type: BI.MultiStringList.REQ_GET_ALL_DATA + type: BI.MultiSelectList.REQ_GET_ALL_DATA }, function (ob) { self._allData = BI.pluck(ob.items, "value"); digest(self._allData); @@ -11174,7 +11174,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { var self = this, o = this.options; this._assertValue(res); o.itemsCreator({ - type: BI.MultiStringList.REQ_GET_ALL_DATA, + type: BI.MultiSelectList.REQ_GET_ALL_DATA, keyword: self.trigger.getKeyword() }, function (ob) { var items = BI.pluck(ob.items, "value"); @@ -11211,7 +11211,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { var self = this, o = this.options; if (!this._count) { o.itemsCreator({ - type: BI.MultiStringList.REQ_GET_DATA_LENGTH + type: BI.MultiSelectList.REQ_GET_DATA_LENGTH }, function (res) { self._count = res.count; adjust(); @@ -11294,13 +11294,214 @@ BI.MultiStringList = BI.inherit(BI.Widget, { } }); -BI.extend(BI.MultiStringList, { +BI.extend(BI.MultiSelectList, { REQ_GET_DATA_LENGTH: 0, REQ_GET_ALL_DATA: -1 }); -BI.MultiStringList.EVENT_CHANGE = "BI.MultiStringList.EVENT_CHANGE"; -BI.shortcut("bi.multi_string_list", BI.MultiStringList);/** +BI.MultiSelectList.EVENT_CHANGE = "BI.MultiSelectList.EVENT_CHANGE"; +BI.shortcut("bi.multi_select_list", BI.MultiSelectList);/** + * Created by zcf_1 on 2017/5/11. + */ +BI.MultiSelectTree = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.MultiSelectTree.superclass._defaultConfig.apply(this, arguments), { + baseCls: 'bi-multi-select-tree', + itemsCreator: BI.emptyFn, + height: 25 + }) + }, + + _init: function () { + BI.MultiSelectTree.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.storeValue = {value: {}}; + + this.adapter = BI.createWidget({ + type: "bi.multi_select_tree_popup", + itemsCreator: o.itemsCreator + }); + this.adapter.on(BI.MultiSelectTreePopup.EVENT_CHANGE, function () { + if (self.trigger.isSearching()) { + self.storeValue = {value: self.searcherPane.getValue()}; + } else { + self.storeValue = {value: self.adapter.getValue()}; + } + self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE); + }); + + this.searcherPane = BI.createWidget({//搜索中的时候用的是parttree,同adapter中的synctree不一样 + type: "bi.multi_tree_search_pane", + cls: "bi-border-left bi-border-right bi-border-bottom", + keywordGetter: function () { + return self.trigger.getKeyword(); + }, + itemsCreator: function (op, callback) { + op.keyword = self.trigger.getKeyword(); + o.itemsCreator(op, callback); + } + }); + this.searcherPane.setVisible(false); + + this.trigger = BI.createWidget({ + type: "bi.searcher", + isAutoSearch: false, + isAutoSync: false, + onSearch: function (op, callback) { + callback({ + keyword: self.trigger.getKeyword() + }); + }, + adapter: this.adapter, + popup: this.searcherPane, + height: 200, + masker: false, + listeners: [{ + eventName: BI.Searcher.EVENT_START, + action: function () { + self._showSearcherPane(); + self.storeValue = {value: self.adapter.getValue()}; + self.searcherPane.setValue(self.storeValue); + } + }, { + eventName: BI.Searcher.EVENT_STOP, + action: function () { + self._showAdapter(); + // self.storeValue = {value: self.searcherPane.getValue()}; + self.adapter.setValue(self.storeValue); + BI.nextTick(function () { + self.adapter.populate(); + }); + } + }, { + eventName: BI.Searcher.EVENT_CHANGE, + action: function () { + if (self.trigger.isSearching()) { + self.storeValue = {value: self.searcherPane.getValue()}; + } else { + self.storeValue = {value: self.adapter.getValue()}; + } + self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE); + } + }, { + eventName: BI.Searcher.EVENT_PAUSE, + action: function () { + self._showAdapter(); + } + }] + }); + + BI.createWidget({ + type: "bi.vtape", + element: this, + height: "100%", + width: "100%", + items: [{ + el: this.trigger, + height: 30 + }, { + el: this.adapter, + height: "fill" + }] + }); + BI.createWidget({ + type: "bi.absolute", + element: this, + height: "100%", + width: "100%", + items: [{ + el: this.searcherPane, + top: 30, + bottom: 0, + left: 0, + right: 0 + }] + }) + + }, + + _showAdapter: function () { + this.adapter.setVisible(true); + this.searcherPane.setVisible(false); + }, + + _showSearcherPane: function () { + this.searcherPane.setVisible(true); + this.adapter.setVisible(false); + }, + + resize: function () { + + }, + + setValue: function (v) { + this.storeValue.value = v || {}; + this.adapter.setValue({ + value: v || {} + }); + this.trigger.setValue({ + value: v || {} + }); + }, + + getValue: function () { + return this.storeValue.value; + }, + + populate: function () { + this.trigger.populate.apply(this.trigger, arguments); + this.adapter.populate.apply(this.adapter, arguments); + } +}); +BI.MultiSelectTree.EVENT_CHANGE = "BI.MultiSelectTree.EVENT_CHANGE"; +BI.shortcut("bi.multi_select_tree", BI.MultiSelectTree);/** + * Created by zcf on 2016/12/21. + */ +BI.MultiSelectTreePopup = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.MultiSelectTreePopup.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-multi-select-tree-popup bi-border-left bi-border-right bi-border-bottom", + itemsCreator: BI.emptyFn + }); + }, + _init: function () { + BI.MultiSelectTreePopup.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.popup = BI.createWidget({ + type: "bi.async_tree", + height: 400, + element: this, + itemsCreator: o.itemsCreator + }); + this.popup.on(BI.TreeView.EVENT_AFTERINIT, function () { + self.fireEvent(BI.MultiSelectTreePopup.EVENT_AFTER_INIT) + }); + this.popup.on(BI.TreeView.EVENT_CHANGE, function () { + self.fireEvent(BI.MultiSelectTreePopup.EVENT_CHANGE) + }); + }, + + hasChecked: function () { + return this.popup.hasChecked(); + }, + + getValue: function () { + return this.popup.getValue(); + }, + + setValue: function (v) { + v || (v = {}); + this.popup.setValue(v.value); + }, + + populate: function (config) { + this.popup.stroke(config); + } + +}); +BI.MultiSelectTreePopup.EVENT_AFTER_INIT = "BI.MultiSelectTreePopup.EVENT_AFTER_INIT"; +BI.MultiSelectTreePopup.EVENT_CHANGE = "BI.MultiSelectTreePopup.EVENT_CHANGE"; +BI.shortcut("bi.multi_select_tree_popup", BI.MultiSelectTreePopup);/** * * @class BI.MultiTreeCheckPane * @extends BI.Pane @@ -11695,7 +11896,7 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, { this.selectedValues = {}; this.tree = BI.createWidget({ - type: "bi.sync_tree", + type: "bi.async_tree", height: 400, cls:"popup-view-tree", itemsCreator: opts.itemsCreator, @@ -12039,208 +12240,7 @@ BI.MultiTreeSearcher.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiTreeSearcher.EVENT_START = "EVENT_START"; BI.MultiTreeSearcher.EVENT_STOP = "EVENT_STOP"; BI.MultiTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE"; -BI.shortcut('bi.multi_tree_searcher', BI.MultiTreeSearcher);/** - * Created by zcf_1 on 2017/5/11. - */ -BI.MultiSelectTree = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.MultiSelectTree.superclass._defaultConfig.apply(this, arguments), { - baseCls: 'bi-multi-tree-combo', - itemsCreator: BI.emptyFn, - height: 25 - }) - }, - - _init: function () { - BI.MultiSelectTree.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.storeValue = {value: {}}; - - this.adapter = BI.createWidget({ - type: "bi.multi_select_tree_popup", - itemsCreator: o.itemsCreator - }); - this.adapter.on(BI.MultiSelectTreePopup.EVENT_CHANGE, function () { - if (self.trigger.isSearching()) { - self.storeValue = {value: self.searcherPane.getValue()}; - } else { - self.storeValue = {value: self.adapter.getValue()}; - } - self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE); - }); - - this.searcherPane = BI.createWidget({//搜索中的时候用的是parttree,同adapter中的synctree不一样 - type: "bi.multi_tree_search_pane", - cls: "bi-border-left bi-border-right bi-border-bottom", - keywordGetter: function () { - return self.trigger.getKeyword(); - }, - itemsCreator: function (op, callback) { - op.keyword = self.trigger.getKeyword(); - o.itemsCreator(op, callback); - } - }); - this.searcherPane.setVisible(false); - - this.trigger = BI.createWidget({ - type: "bi.searcher", - isAutoSearch: false, - isAutoSync: false, - onSearch: function (op, callback) { - callback({ - keyword: self.trigger.getKeyword() - }); - }, - adapter: this.adapter, - popup: this.searcherPane, - height: 200, - masker: false, - listeners: [{ - eventName: BI.Searcher.EVENT_START, - action: function () { - self._showSearcherPane(); - self.storeValue = {value: self.adapter.getValue()}; - self.searcherPane.setValue(self.storeValue); - } - }, { - eventName: BI.Searcher.EVENT_STOP, - action: function () { - self._showAdapter(); - // self.storeValue = {value: self.searcherPane.getValue()}; - self.adapter.setValue(self.storeValue); - BI.nextTick(function () { - self.adapter.populate(); - }); - } - }, { - eventName: BI.Searcher.EVENT_CHANGE, - action: function () { - if (self.trigger.isSearching()) { - self.storeValue = {value: self.searcherPane.getValue()}; - } else { - self.storeValue = {value: self.adapter.getValue()}; - } - self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE); - } - }, { - eventName: BI.Searcher.EVENT_PAUSE, - action: function () { - self._showAdapter(); - } - }] - }); - - BI.createWidget({ - type: "bi.vtape", - element: this, - height: "100%", - width: "100%", - items: [{ - el: this.trigger, - height: 30 - }, { - el: this.adapter, - height: "fill" - }] - }); - BI.createWidget({ - type: "bi.absolute", - element: this, - height: "100%", - width: "100%", - items: [{ - el: this.searcherPane, - top: 30, - bottom: 0, - left: 0, - right: 0 - }] - }) - - }, - - _showAdapter: function () { - this.adapter.setVisible(true); - this.searcherPane.setVisible(false); - }, - - _showSearcherPane: function () { - this.searcherPane.setVisible(true); - this.adapter.setVisible(false); - }, - - resize: function () { - - }, - - setValue: function (v) { - this.storeValue.value = v || {}; - this.adapter.setValue({ - value: v || {} - }); - this.trigger.setValue({ - value: v || {} - }); - }, - - getValue: function () { - return this.storeValue.value; - }, - - populate: function () { - this.trigger.populate.apply(this.trigger, arguments); - this.adapter.populate.apply(this.adapter, arguments); - } -}); -BI.MultiSelectTree.EVENT_CHANGE = "BI.MultiSelectTree.EVENT_CHANGE"; -BI.shortcut("bi.multi_select_tree", BI.MultiSelectTree);/** - * Created by zcf on 2016/12/21. - */ -BI.MultiSelectTreePopup = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.MultiSelectTreePopup.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-tree-list-popup bi-border-left bi-border-right bi-border-bottom", - itemsCreator: BI.emptyFn - }); - }, - _init: function () { - BI.MultiSelectTreePopup.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.popup = BI.createWidget({ - type: "bi.sync_tree", - height: 400, - element: this, - itemsCreator: o.itemsCreator - }); - this.popup.on(BI.TreeView.EVENT_AFTERINIT, function () { - self.fireEvent(BI.MultiSelectTreePopup.EVENT_AFTER_INIT) - }); - this.popup.on(BI.TreeView.EVENT_CHANGE, function () { - self.fireEvent(BI.MultiSelectTreePopup.EVENT_CHANGE) - }); - }, - - hasChecked: function () { - return this.popup.hasChecked(); - }, - - getValue: function () { - return this.popup.getValue(); - }, - - setValue: function (v) { - v || (v = {}); - this.popup.setValue(v.value); - }, - - populate: function (config) { - this.popup.stroke(config); - } - -}); -BI.MultiSelectTreePopup.EVENT_AFTER_INIT = "BI.MultiSelectTreePopup.EVENT_AFTER_INIT"; -BI.MultiSelectTreePopup.EVENT_CHANGE = "BI.MultiSelectTreePopup.EVENT_CHANGE"; -BI.shortcut("bi.multi_select_tree_popup", BI.MultiSelectTreePopup);//小于号的值为:0,小于等于号的值为:1 +BI.shortcut('bi.multi_tree_searcher', BI.MultiTreeSearcher);//小于号的值为:0,小于等于号的值为:1 //closeMIn:最小值的符号,closeMax:最大值的符号 /** * Created by roy on 15/9/17. @@ -15964,6 +15964,7 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { }, setVPage: function (v) { + v = v < 1 ? 1 : v; var o = this.options; this.start = (v - 1) * o.pageSize + 1; }, diff --git a/src/base/tree/synctree.js b/src/base/tree/asynctree.js similarity index 91% rename from src/base/tree/synctree.js rename to src/base/tree/asynctree.js index 7aa8bbf2d..96f9c900d 100644 --- a/src/base/tree/synctree.js +++ b/src/base/tree/asynctree.js @@ -1,15 +1,15 @@ /** * guy * 同步树 - * @class BI.SyncTree + * @class BI.AsyncTree * @extends BI.TreeView */ -BI.SyncTree = BI.inherit(BI.TreeView, { +BI.AsyncTree = BI.inherit(BI.TreeView, { _defaultConfig: function () { - return BI.extend(BI.SyncTree.superclass._defaultConfig.apply(this, arguments), {}) + return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {}) }, _init: function () { - BI.SyncTree.superclass._init.apply(this, arguments); + BI.AsyncTree.superclass._init.apply(this, arguments); }, //配置属性 @@ -79,7 +79,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, { } function beforeExpand(treeId, treeNode) { - self._expandNode(treeId, treeNode); + self._beforeExpandNode(treeId, treeNode); } function onCheck(event, treeId, treeNode) { @@ -100,7 +100,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, { _selectTreeNode: function (treeId, treeNode) { var self = this, o = this.options; var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); - var name = this._getNodeValue(treeNode) + var name = this._getNodeValue(treeNode); // var values = parentValues.concat([name]); if (treeNode.checked === true) { } else { @@ -119,11 +119,11 @@ BI.SyncTree = BI.inherit(BI.TreeView, { } } } - BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); + BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments); }, //展开节点 - _expandNode: function (treeId, treeNode) { + _beforeExpandNode: function (treeId, treeNode) { var self = this, o = this.options; var parentValues = treeNode.parentValues || self._getParentValues(treeNode); var op = BI.extend({}, o.paras, { @@ -178,7 +178,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, { }, hasChecked: function () { - return !BI.isEmpty(this.selectedValues) || BI.SyncTree.superclass.hasChecked.apply(this, arguments); + return !BI.isEmpty(this.selectedValues) || BI.AsyncTree.superclass.hasChecked.apply(this, arguments); }, getValue: function () { @@ -206,4 +206,4 @@ BI.SyncTree = BI.inherit(BI.TreeView, { } }); -BI.shortcut("bi.sync_tree", BI.SyncTree); \ No newline at end of file +BI.shortcut("bi.async_tree", BI.AsyncTree); \ No newline at end of file diff --git a/src/base/tree/parttree.js b/src/base/tree/parttree.js index a3f809cdd..e75cce7a0 100644 --- a/src/base/tree/parttree.js +++ b/src/base/tree/parttree.js @@ -2,9 +2,9 @@ * guy * 局部树,两个请求树, 第一个请求构造树,第二个请求获取节点 * @class BI.PartTree - * @extends BI.SyncTree + * @extends BI.AsyncTree */ -BI.PartTree = BI.inherit(BI.SyncTree, { +BI.PartTree = BI.inherit(BI.AsyncTree, { _defaultConfig: function () { return BI.extend(BI.PartTree.superclass._defaultConfig.apply(this, arguments), {}) }, @@ -43,7 +43,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, { var name = this._getNodeValue(treeNode) // var values = parentValues.concat([name]); if (treeNode.checked === true) { - BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); + BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments); } else { o.itemsCreator(BI.extend({}, o.paras, { type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA, @@ -68,7 +68,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, { } } self.selectedValues = new_values; - BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); + BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments); }); } }, diff --git a/src/base/tree/treeview.js b/src/base/tree/treeview.js index 8c0762c29..204d5936a 100644 --- a/src/base/tree/treeview.js +++ b/src/base/tree/treeview.js @@ -469,6 +469,12 @@ BI.TreeView = BI.inherit(BI.Pane, { }); }, + getExpandedValue: function(){ + if (!this.nodes) { + return null; + } + }, + refresh: function () { this.nodes && this.nodes.refresh(); }, diff --git a/src/case/pager/pager.all.count.js b/src/case/pager/pager.all.count.js index fee63982f..5a029ca75 100644 --- a/src/case/pager/pager.all.count.js +++ b/src/case/pager/pager.all.count.js @@ -132,6 +132,10 @@ BI.AllCountPager = BI.inherit(BI.Widget, { this.pager.setValue(v); }, + setVPage: function (v) { + this.pager.setValue(v); + }, + setCount: function (count) { this.rowCount.setText(count); this.rowCount.setTitle(count); diff --git a/src/less/widget/multistringlist/multistringlist.less b/src/less/widget/multistringlist/multistringlist.less index 4610336cf..7511c1200 100644 --- a/src/less/widget/multistringlist/multistringlist.less +++ b/src/less/widget/multistringlist/multistringlist.less @@ -1,5 +1,5 @@ @import "../../bibase"; -.bi-multi-string-list{ - & .popup-multi-string-list{ +.bi-multi-select-list{ + & .popup-multi-select-list{ } } \ No newline at end of file diff --git a/src/polyfill/array.js b/src/polyfill/array.js index 65f018588..5dadd1588 100644 --- a/src/polyfill/array.js +++ b/src/polyfill/array.js @@ -4,7 +4,7 @@ if(![].indexOf){ * @param {Object} o 要检查的值 * @return {Number} o在数组中的索引(如果不在数组中则返回-1) */ - [].indexOf = function (o) { + Array.prototype.indexOf = function (o) { for (var i = 0, len = this.length; i < len; i++) { if (_.isEqual(o, this[i])) { return i; @@ -20,7 +20,7 @@ if(![].lastIndexOf){ * @param {Object} o 要检查的值 * @return {Number} o在数组中的索引(如果不在数组中则返回-1) */ - [].lastIndexOf = function (o) { + Array.prototype.lastIndexOf = function (o) { for (var len = this.length, i = len - 1; i >= 0; i--) { if (_.isEqual(o, this[i])) { return i; diff --git a/src/widget/multistringlist/multistringlist.js b/src/widget/multiselectlist/multiselectlist.js similarity index 93% rename from src/widget/multistringlist/multistringlist.js rename to src/widget/multiselectlist/multiselectlist.js index f1783428d..4913c7e41 100644 --- a/src/widget/multistringlist/multistringlist.js +++ b/src/widget/multiselectlist/multiselectlist.js @@ -1,17 +1,17 @@ /** * Created by zcf_1 on 2017/5/2. */ -BI.MultiStringList = BI.inherit(BI.Widget, { +BI.MultiSelectList = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.MultiStringList.superclass._defaultConfig.apply(this, arguments), { - baseCls: 'bi-multi-string-list', + return BI.extend(BI.MultiSelectList.superclass._defaultConfig.apply(this, arguments), { + baseCls: 'bi-multi-select-list', itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, el: {} }) }, _init: function () { - BI.MultiStringList.superclass._init.apply(this, arguments); + BI.MultiSelectList.superclass._init.apply(this, arguments); var self = this, o = this.options; this.storeValue = {}; @@ -22,7 +22,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { this.adapter = BI.createWidget({ type: "bi.multi_select_loader", - cls: "popup-multi-string-list bi-border-left bi-border-right bi-border-bottom", + cls: "popup-multi-select-list bi-border-left bi-border-right bi-border-bottom", itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, // onLoaded: o.onLoaded, @@ -34,7 +34,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { self.storeValue = this.getValue(); self._adjust(function () { assertShowValue(); - self.fireEvent(BI.MultiStringList.EVENT_CHANGE); + self.fireEvent(BI.MultiSelectList.EVENT_CHANGE); }); }); @@ -93,7 +93,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { self._setStartValue(keyword); assertShowValue(); self._setStartValue(""); - self.fireEvent(BI.MultiStringList.EVENT_CHANGE); + self.fireEvent(BI.MultiSelectList.EVENT_CHANGE); }) } else { self._showAdapter(); @@ -194,7 +194,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { this._assertValue(this.storeValue); if (!this._allData) { o.itemsCreator({ - type: BI.MultiStringList.REQ_GET_ALL_DATA + type: BI.MultiSelectList.REQ_GET_ALL_DATA }, function (ob) { self._allData = BI.pluck(ob.items, "value"); digest(self._allData); @@ -218,7 +218,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { var self = this, o = this.options; this._assertValue(res); o.itemsCreator({ - type: BI.MultiStringList.REQ_GET_ALL_DATA, + type: BI.MultiSelectList.REQ_GET_ALL_DATA, keyword: self.trigger.getKeyword() }, function (ob) { var items = BI.pluck(ob.items, "value"); @@ -255,7 +255,7 @@ BI.MultiStringList = BI.inherit(BI.Widget, { var self = this, o = this.options; if (!this._count) { o.itemsCreator({ - type: BI.MultiStringList.REQ_GET_DATA_LENGTH + type: BI.MultiSelectList.REQ_GET_DATA_LENGTH }, function (res) { self._count = res.count; adjust(); @@ -338,10 +338,10 @@ BI.MultiStringList = BI.inherit(BI.Widget, { } }); -BI.extend(BI.MultiStringList, { +BI.extend(BI.MultiSelectList, { REQ_GET_DATA_LENGTH: 0, REQ_GET_ALL_DATA: -1 }); -BI.MultiStringList.EVENT_CHANGE = "BI.MultiStringList.EVENT_CHANGE"; -BI.shortcut("bi.multi_string_list", BI.MultiStringList); \ No newline at end of file +BI.MultiSelectList.EVENT_CHANGE = "BI.MultiSelectList.EVENT_CHANGE"; +BI.shortcut("bi.multi_select_list", BI.MultiSelectList); \ No newline at end of file diff --git a/src/widget/multitreelist/multitreelist.js b/src/widget/multiselecttree/multiselecttree.js similarity index 97% rename from src/widget/multitreelist/multitreelist.js rename to src/widget/multiselecttree/multiselecttree.js index 2403eac14..4475e433e 100644 --- a/src/widget/multitreelist/multitreelist.js +++ b/src/widget/multiselecttree/multiselecttree.js @@ -4,7 +4,7 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.MultiSelectTree.superclass._defaultConfig.apply(this, arguments), { - baseCls: 'bi-multi-tree-combo', + baseCls: 'bi-multi-select-tree', itemsCreator: BI.emptyFn, height: 25 }) diff --git a/src/widget/multitreelist/multitreelist.popup.js b/src/widget/multiselecttree/multiselecttree.popup.js similarity index 91% rename from src/widget/multitreelist/multitreelist.popup.js rename to src/widget/multiselecttree/multiselecttree.popup.js index 864137a9c..8f8ee61b2 100644 --- a/src/widget/multitreelist/multitreelist.popup.js +++ b/src/widget/multiselecttree/multiselecttree.popup.js @@ -4,7 +4,7 @@ BI.MultiSelectTreePopup = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.MultiSelectTreePopup.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-tree-list-popup bi-border-left bi-border-right bi-border-bottom", + baseCls: "bi-multi-select-tree-popup bi-border-left bi-border-right bi-border-bottom", itemsCreator: BI.emptyFn }); }, @@ -12,7 +12,7 @@ BI.MultiSelectTreePopup = BI.inherit(BI.Widget, { BI.MultiSelectTreePopup.superclass._init.apply(this, arguments); var self = this, o = this.options; this.popup = BI.createWidget({ - type: "bi.sync_tree", + type: "bi.async_tree", height: 400, element: this, itemsCreator: o.itemsCreator diff --git a/src/widget/multitree/multi.tree.popup.js b/src/widget/multitree/multi.tree.popup.js index e8c5cded0..349779d23 100644 --- a/src/widget/multitree/multi.tree.popup.js +++ b/src/widget/multitree/multi.tree.popup.js @@ -23,7 +23,7 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, { this.selectedValues = {}; this.tree = BI.createWidget({ - type: "bi.sync_tree", + type: "bi.async_tree", height: 400, cls:"popup-view-tree", itemsCreator: opts.itemsCreator, diff --git a/src/widget/sequencetable/listnumber.sequencetable.js b/src/widget/sequencetable/listnumber.sequencetable.js index bab51144a..94e288233 100644 --- a/src/widget/sequencetable/listnumber.sequencetable.js +++ b/src/widget/sequencetable/listnumber.sequencetable.js @@ -211,6 +211,7 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { }, setVPage: function (v) { + v = v < 1 ? 1 : v; var o = this.options; this.start = (v - 1) * o.pageSize + 1; },