From 16bb938ad84b8e512a97668bc6634b6849e97a38 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 27 Apr 2017 16:30:12 +0800 Subject: [PATCH] add --- bi/base.js | 24 +++--- bi/core.js | 6 +- bi/widget.js | 83 ++++++++++++++----- demo/js/component/demo.treevaluechooser.js | 4 +- docs/base.js | 24 +++--- docs/core.js | 6 +- docs/demo.js | 4 +- docs/widget.js | 83 ++++++++++++++----- src/base/pane.js | 2 +- src/base/single/text.js | 2 +- src/base/tree/treeview.js | 20 +++-- src/core/func/dom.js | 6 +- src/widget/downlist/combo.downlist.js | 2 +- .../sequencetable/listnumber.sequencetable.js | 37 +++++++-- .../sequencetable/treenumber.sequencetable.js | 44 +++++++--- 15 files changed, 241 insertions(+), 106 deletions(-) diff --git a/bi/base.js b/bi/base.js index b3733a9cc..9e03201b1 100644 --- a/bi/base.js +++ b/bi/base.js @@ -279,7 +279,7 @@ BI.Pane = BI.inherit(BI.Widget, { loaded: function () { var self = this, o = this.options; - BI.Layers.remove(self.getName()); + BI.Maskers.remove(self.getName()); this._loading && this._loading.destroy(); this._loading && (this._loading = null); o.onLoaded(); @@ -577,7 +577,7 @@ BI.Text = BI.inherit(BI.Single, { setText: function (text) { BI.Text.superclass.setText.apply(this, arguments); this.options.text = text; - this.text.element.html(BI.escape(text).replaceAll(" ", " ")); + this.text.element.text((text + "").replaceAll(" ", " ")); } }); @@ -1793,14 +1793,15 @@ BI.TreeView = BI.inherit(BI.Pane, { //处理节点 _dealWidthNodes: function (nodes) { var self = this, o = this.options; - //处理标红 - if (BI.isKey(o.paras.keyword)) { - var keyword = o.paras.keyword; - var ns = BI.Tree.arrayFormat(nodes); - BI.each(ns, function (i, n) { - n.text = $("
").__textKeywordMarked__(n.text, keyword, n.py).html(); - }); - } + var ns = BI.Tree.arrayFormat(nodes); + BI.each(ns, function (i, n) { + //处理标红 + if (BI.isKey(o.paras.keyword)) { + n.text = $("
").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html(); + } else { + n.text = (n.text + "").replaceAll(" ", " "); + } + }); return nodes; }, @@ -1886,7 +1887,8 @@ BI.TreeView = BI.inherit(BI.Pane, { }, view: { showIcon: false, - expandSpeed: "" + expandSpeed: "", + nameIsHTML: true }, callback: {} }; diff --git a/bi/core.js b/bi/core.js index 31666f1d4..fa4761ae1 100644 --- a/bi/core.js +++ b/bi/core.js @@ -16452,7 +16452,7 @@ BI.extend(jQuery.fn, { */ __textKeywordMarked__: function (text, keyword, py) { if (!BI.isKey(keyword)) { - return this.text(text); + return this.text((text + "").replaceAll(" ", " ")); } keyword = keyword + ""; keyword = BI.toUpperCase(keyword); @@ -16475,7 +16475,7 @@ BI.extend(jQuery.fn, { if (tidx >= 0) { this.append(textLeft.substr(0, tidx)); this.append($("").addClass("bi-keyword-red-mark") - .text(textLeft.substr(tidx, keyword.length))); + .text(textLeft.substr(tidx, keyword.length).replaceAll(" ", " "))); textLeft = textLeft.substr(tidx + keyword.length); if (py != null) { @@ -16484,7 +16484,7 @@ BI.extend(jQuery.fn, { } else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) { this.append(textLeft.substr(0, pidx)); this.append($("").addClass("bi-keyword-red-mark") - .text(textLeft.substr(pidx, keyword.length))); + .text(textLeft.substr(pidx, keyword.length).replaceAll(" ", " "))); if (py != null) { py = py.substr(pidx + keyword.length); } diff --git a/bi/widget.js b/bi/widget.js index 3bb84441c..59c272388 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -35,12 +35,6 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget(o.sequenceHeaderCreator || { - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -54,13 +48,20 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { items: [this.container] }); + this.headerContainer = BI.createWidget({ + type: "bi.absolute", + cls: "bi-border", + width: 58, + scrollable: false + }); + this.layout = BI.createWidget({ type: "bi.vtape", element: this, items: [{ - el: this.header, - height: this._getHeaderHeight() - }, { + el: this.headerContainer, + height: this._getHeaderHeight() - 2 + }, {el: {type: "bi.layout"}, height: 2}, { el: this.scrollContainer }] }); @@ -168,7 +169,7 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { _layout: function () { var self = this, o = this.options; - var headerHeight = this._getHeaderHeight(); + var headerHeight = this._getHeaderHeight() - 2; var items = this.layout.attr("items"); if (o.isNeedFreeze === false) { items[0].height = 0; @@ -217,6 +218,26 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { return Math.max(0, cnt * this.options.rowSize - (this.options.height - this._getHeaderHeight()) + BI.DOM.getScrollWidth()); }, + _createHeader: function () { + var o = this.options; + BI.createWidget({ + type: "bi.absolute", + element: this.headerContainer, + items: [{ + el: o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }, + left: 0, + top: 0, + right: 0, + bottom: 0 + }] + }); + }, + _calculateChildrenToRender: function () { var self = this, o = this.options; @@ -322,7 +343,8 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { task.apply(self); }); this.tasks = []; - this.header.populate(); + this.headerContainer.empty(); + this._createHeader(); this._layout(); this._calculateChildrenToRender(); }, @@ -5595,7 +5617,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, { popup: { el: this.popupview, stopPropagation: true, - maxHeight: 400 + maxHeight: 1000 } }); @@ -15746,12 +15768,6 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget(o.sequenceHeaderCreator || { - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -15765,12 +15781,19 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { items: [this.container] }); + this.headerContainer = BI.createWidget({ + type: "bi.absolute", + cls: "bi-border", + width: 58, + scrollable: false + }); + this.layout = BI.createWidget({ type: "bi.vtape", element: this, items: [{ - el: this.header, - height: o.headerRowSize * o.header.length + el: this.headerContainer, + height: o.headerRowSize * o.header.length - 2 }, { el: this.scrollContainer }] @@ -15793,6 +15816,26 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { this.scrollContainer.element.scrollTop(o.scrollTop); }, + _createHeader: function () { + var o = this.options; + BI.createWidget({ + type: "bi.absolute", + element: this.headerContainer, + items: [{ + el: o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }, + left: 0, + top: 0, + right: 0, + bottom: 0 + }] + }); + }, + _calculateChildrenToRender: function () { var self = this, o = this.options; var scrollTop = BI.clamp(o.scrollTop, 0, o.rowSize * o.items.length - (o.height - o.header.length * o.headerRowSize) + BI.DOM.getScrollWidth()); diff --git a/demo/js/component/demo.treevaluechooser.js b/demo/js/component/demo.treevaluechooser.js index eec990902..3ec16d44f 100644 --- a/demo/js/component/demo.treevaluechooser.js +++ b/demo/js/component/demo.treevaluechooser.js @@ -7,8 +7,8 @@ Demo.TreeValueChooser = BI.inherit(BI.Widget, { var tree = []; for (var i = 0; i < 21; i++) { tree.push({ - value: i + "", - text: i + "", + value: " " + i + "", + text: " " + i + "", id: i + "", pId: null }); diff --git a/docs/base.js b/docs/base.js index b3733a9cc..9e03201b1 100644 --- a/docs/base.js +++ b/docs/base.js @@ -279,7 +279,7 @@ BI.Pane = BI.inherit(BI.Widget, { loaded: function () { var self = this, o = this.options; - BI.Layers.remove(self.getName()); + BI.Maskers.remove(self.getName()); this._loading && this._loading.destroy(); this._loading && (this._loading = null); o.onLoaded(); @@ -577,7 +577,7 @@ BI.Text = BI.inherit(BI.Single, { setText: function (text) { BI.Text.superclass.setText.apply(this, arguments); this.options.text = text; - this.text.element.html(BI.escape(text).replaceAll(" ", " ")); + this.text.element.text((text + "").replaceAll(" ", " ")); } }); @@ -1793,14 +1793,15 @@ BI.TreeView = BI.inherit(BI.Pane, { //处理节点 _dealWidthNodes: function (nodes) { var self = this, o = this.options; - //处理标红 - if (BI.isKey(o.paras.keyword)) { - var keyword = o.paras.keyword; - var ns = BI.Tree.arrayFormat(nodes); - BI.each(ns, function (i, n) { - n.text = $("
").__textKeywordMarked__(n.text, keyword, n.py).html(); - }); - } + var ns = BI.Tree.arrayFormat(nodes); + BI.each(ns, function (i, n) { + //处理标红 + if (BI.isKey(o.paras.keyword)) { + n.text = $("
").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html(); + } else { + n.text = (n.text + "").replaceAll(" ", " "); + } + }); return nodes; }, @@ -1886,7 +1887,8 @@ BI.TreeView = BI.inherit(BI.Pane, { }, view: { showIcon: false, - expandSpeed: "" + expandSpeed: "", + nameIsHTML: true }, callback: {} }; diff --git a/docs/core.js b/docs/core.js index d43105a13..58670eef3 100644 --- a/docs/core.js +++ b/docs/core.js @@ -21978,7 +21978,7 @@ BI.extend(jQuery.fn, { */ __textKeywordMarked__: function (text, keyword, py) { if (!BI.isKey(keyword)) { - return this.text(text); + return this.text((text + "").replaceAll(" ", " ")); } keyword = keyword + ""; keyword = BI.toUpperCase(keyword); @@ -22001,7 +22001,7 @@ BI.extend(jQuery.fn, { if (tidx >= 0) { this.append(textLeft.substr(0, tidx)); this.append($("").addClass("bi-keyword-red-mark") - .text(textLeft.substr(tidx, keyword.length))); + .text(textLeft.substr(tidx, keyword.length).replaceAll(" ", " "))); textLeft = textLeft.substr(tidx + keyword.length); if (py != null) { @@ -22010,7 +22010,7 @@ BI.extend(jQuery.fn, { } else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) { this.append(textLeft.substr(0, pidx)); this.append($("").addClass("bi-keyword-red-mark") - .text(textLeft.substr(pidx, keyword.length))); + .text(textLeft.substr(pidx, keyword.length).replaceAll(" ", " "))); if (py != null) { py = py.substr(pidx + keyword.length); } diff --git a/docs/demo.js b/docs/demo.js index b91d3b6be..b9f465dad 100644 --- a/docs/demo.js +++ b/docs/demo.js @@ -2436,8 +2436,8 @@ BI.shortcut("demo.center", Demo.Center);Demo.TreeValueChooser = BI.inherit(BI.Wi var tree = []; for (var i = 0; i < 21; i++) { tree.push({ - value: i + "", - text: i + "", + value: " " + i + "", + text: " " + i + "", id: i + "", pId: null }); diff --git a/docs/widget.js b/docs/widget.js index 3bb84441c..59c272388 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -35,12 +35,6 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget(o.sequenceHeaderCreator || { - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -54,13 +48,20 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { items: [this.container] }); + this.headerContainer = BI.createWidget({ + type: "bi.absolute", + cls: "bi-border", + width: 58, + scrollable: false + }); + this.layout = BI.createWidget({ type: "bi.vtape", element: this, items: [{ - el: this.header, - height: this._getHeaderHeight() - }, { + el: this.headerContainer, + height: this._getHeaderHeight() - 2 + }, {el: {type: "bi.layout"}, height: 2}, { el: this.scrollContainer }] }); @@ -168,7 +169,7 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { _layout: function () { var self = this, o = this.options; - var headerHeight = this._getHeaderHeight(); + var headerHeight = this._getHeaderHeight() - 2; var items = this.layout.attr("items"); if (o.isNeedFreeze === false) { items[0].height = 0; @@ -217,6 +218,26 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { return Math.max(0, cnt * this.options.rowSize - (this.options.height - this._getHeaderHeight()) + BI.DOM.getScrollWidth()); }, + _createHeader: function () { + var o = this.options; + BI.createWidget({ + type: "bi.absolute", + element: this.headerContainer, + items: [{ + el: o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }, + left: 0, + top: 0, + right: 0, + bottom: 0 + }] + }); + }, + _calculateChildrenToRender: function () { var self = this, o = this.options; @@ -322,7 +343,8 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { task.apply(self); }); this.tasks = []; - this.header.populate(); + this.headerContainer.empty(); + this._createHeader(); this._layout(); this._calculateChildrenToRender(); }, @@ -5595,7 +5617,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, { popup: { el: this.popupview, stopPropagation: true, - maxHeight: 400 + maxHeight: 1000 } }); @@ -15746,12 +15768,6 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget(o.sequenceHeaderCreator || { - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -15765,12 +15781,19 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { items: [this.container] }); + this.headerContainer = BI.createWidget({ + type: "bi.absolute", + cls: "bi-border", + width: 58, + scrollable: false + }); + this.layout = BI.createWidget({ type: "bi.vtape", element: this, items: [{ - el: this.header, - height: o.headerRowSize * o.header.length + el: this.headerContainer, + height: o.headerRowSize * o.header.length - 2 }, { el: this.scrollContainer }] @@ -15793,6 +15816,26 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { this.scrollContainer.element.scrollTop(o.scrollTop); }, + _createHeader: function () { + var o = this.options; + BI.createWidget({ + type: "bi.absolute", + element: this.headerContainer, + items: [{ + el: o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }, + left: 0, + top: 0, + right: 0, + bottom: 0 + }] + }); + }, + _calculateChildrenToRender: function () { var self = this, o = this.options; var scrollTop = BI.clamp(o.scrollTop, 0, o.rowSize * o.items.length - (o.height - o.header.length * o.headerRowSize) + BI.DOM.getScrollWidth()); diff --git a/src/base/pane.js b/src/base/pane.js index 1ef5b7f29..695cb2f1b 100644 --- a/src/base/pane.js +++ b/src/base/pane.js @@ -78,7 +78,7 @@ BI.Pane = BI.inherit(BI.Widget, { loaded: function () { var self = this, o = this.options; - BI.Layers.remove(self.getName()); + BI.Maskers.remove(self.getName()); this._loading && this._loading.destroy(); this._loading && (this._loading = null); o.onLoaded(); diff --git a/src/base/single/text.js b/src/base/single/text.js index 078195730..12efd184a 100644 --- a/src/base/single/text.js +++ b/src/base/single/text.js @@ -110,7 +110,7 @@ BI.Text = BI.inherit(BI.Single, { setText: function (text) { BI.Text.superclass.setText.apply(this, arguments); this.options.text = text; - this.text.element.html(BI.escape(text).replaceAll(" ", " ")); + this.text.element.text((text + "").replaceAll(" ", " ")); } }); diff --git a/src/base/tree/treeview.js b/src/base/tree/treeview.js index f7b149086..bb5cbd184 100644 --- a/src/base/tree/treeview.js +++ b/src/base/tree/treeview.js @@ -306,14 +306,15 @@ BI.TreeView = BI.inherit(BI.Pane, { //处理节点 _dealWidthNodes: function (nodes) { var self = this, o = this.options; - //处理标红 - if (BI.isKey(o.paras.keyword)) { - var keyword = o.paras.keyword; - var ns = BI.Tree.arrayFormat(nodes); - BI.each(ns, function (i, n) { - n.text = $("
").__textKeywordMarked__(n.text, keyword, n.py).html(); - }); - } + var ns = BI.Tree.arrayFormat(nodes); + BI.each(ns, function (i, n) { + //处理标红 + if (BI.isKey(o.paras.keyword)) { + n.text = $("
").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html(); + } else { + n.text = (n.text + "").replaceAll(" ", " "); + } + }); return nodes; }, @@ -399,7 +400,8 @@ BI.TreeView = BI.inherit(BI.Pane, { }, view: { showIcon: false, - expandSpeed: "" + expandSpeed: "", + nameIsHTML: true }, callback: {} }; diff --git a/src/core/func/dom.js b/src/core/func/dom.js index 82f28d01c..6a6f2dc3b 100644 --- a/src/core/func/dom.js +++ b/src/core/func/dom.js @@ -20,7 +20,7 @@ BI.extend(jQuery.fn, { */ __textKeywordMarked__: function (text, keyword, py) { if (!BI.isKey(keyword)) { - return this.text(text); + return this.text((text + "").replaceAll(" ", " ")); } keyword = keyword + ""; keyword = BI.toUpperCase(keyword); @@ -43,7 +43,7 @@ BI.extend(jQuery.fn, { if (tidx >= 0) { this.append(textLeft.substr(0, tidx)); this.append($("").addClass("bi-keyword-red-mark") - .text(textLeft.substr(tidx, keyword.length))); + .text(textLeft.substr(tidx, keyword.length).replaceAll(" ", " "))); textLeft = textLeft.substr(tidx + keyword.length); if (py != null) { @@ -52,7 +52,7 @@ BI.extend(jQuery.fn, { } else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) { this.append(textLeft.substr(0, pidx)); this.append($("").addClass("bi-keyword-red-mark") - .text(textLeft.substr(pidx, keyword.length))); + .text(textLeft.substr(pidx, keyword.length).replaceAll(" ", " "))); if (py != null) { py = py.substr(pidx + keyword.length); } diff --git a/src/widget/downlist/combo.downlist.js b/src/widget/downlist/combo.downlist.js index e77844e1a..ed37eb40c 100644 --- a/src/widget/downlist/combo.downlist.js +++ b/src/widget/downlist/combo.downlist.js @@ -47,7 +47,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, { popup: { el: this.popupview, stopPropagation: true, - maxHeight: 400 + maxHeight: 1000 } }); diff --git a/src/widget/sequencetable/listnumber.sequencetable.js b/src/widget/sequencetable/listnumber.sequencetable.js index 813f961f4..db308d56f 100644 --- a/src/widget/sequencetable/listnumber.sequencetable.js +++ b/src/widget/sequencetable/listnumber.sequencetable.js @@ -35,12 +35,6 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget(o.sequenceHeaderCreator || { - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -54,12 +48,19 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { items: [this.container] }); + this.headerContainer = BI.createWidget({ + type: "bi.absolute", + cls: "bi-border", + width: 58, + scrollable: false + }); + this.layout = BI.createWidget({ type: "bi.vtape", element: this, items: [{ - el: this.header, - height: o.headerRowSize * o.header.length + el: this.headerContainer, + height: o.headerRowSize * o.header.length - 2 }, { el: this.scrollContainer }] @@ -82,6 +83,26 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { this.scrollContainer.element.scrollTop(o.scrollTop); }, + _createHeader: function () { + var o = this.options; + BI.createWidget({ + type: "bi.absolute", + element: this.headerContainer, + items: [{ + el: o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }, + left: 0, + top: 0, + right: 0, + bottom: 0 + }] + }); + }, + _calculateChildrenToRender: function () { var self = this, o = this.options; var scrollTop = BI.clamp(o.scrollTop, 0, o.rowSize * o.items.length - (o.height - o.header.length * o.headerRowSize) + BI.DOM.getScrollWidth()); diff --git a/src/widget/sequencetable/treenumber.sequencetable.js b/src/widget/sequencetable/treenumber.sequencetable.js index 5965bee77..8c26902e6 100644 --- a/src/widget/sequencetable/treenumber.sequencetable.js +++ b/src/widget/sequencetable/treenumber.sequencetable.js @@ -35,12 +35,6 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget(o.sequenceHeaderCreator || { - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -54,13 +48,20 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { items: [this.container] }); + this.headerContainer = BI.createWidget({ + type: "bi.absolute", + cls: "bi-border", + width: 58, + scrollable: false + }); + this.layout = BI.createWidget({ type: "bi.vtape", element: this, items: [{ - el: this.header, - height: this._getHeaderHeight() - }, { + el: this.headerContainer, + height: this._getHeaderHeight() - 2 + }, {el: {type: "bi.layout"}, height: 2}, { el: this.scrollContainer }] }); @@ -168,7 +169,7 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { _layout: function () { var self = this, o = this.options; - var headerHeight = this._getHeaderHeight(); + var headerHeight = this._getHeaderHeight() - 2; var items = this.layout.attr("items"); if (o.isNeedFreeze === false) { items[0].height = 0; @@ -217,6 +218,26 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { return Math.max(0, cnt * this.options.rowSize - (this.options.height - this._getHeaderHeight()) + BI.DOM.getScrollWidth()); }, + _createHeader: function () { + var o = this.options; + BI.createWidget({ + type: "bi.absolute", + element: this.headerContainer, + items: [{ + el: o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }, + left: 0, + top: 0, + right: 0, + bottom: 0 + }] + }); + }, + _calculateChildrenToRender: function () { var self = this, o = this.options; @@ -322,7 +343,8 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { task.apply(self); }); this.tasks = []; - this.header.populate(); + this.headerContainer.empty(); + this._createHeader(); this._layout(); this._calculateChildrenToRender(); },