@@ -58,23 +58,6 @@ PivotView.prototype.init = function () {
5858
5959} ;
6060
61- //PivotView.prototype._sizesChanged = function () {
62- //
63- // for (var i in this.tablesStack) {
64- // var t = this.tablesStack[i]._headers;
65- // if (t.c.clone) {
66- // for (var u in t) {
67- // this.fixSizes(t[u].base, t[u].clone);
68- // }
69- // }
70- // if (t.v.clone) {
71- // t.v.clone.style.width = "";
72- // t.v.clone.style.zIndex = 1;
73- // }
74- // }
75- //
76- //};
77-
7861PivotView . prototype . updateSizes = function ( ) {
7962
8063 for ( var i in this . tablesStack ) {
@@ -211,122 +194,6 @@ PivotView.prototype._cellClickHandler = function (x, y, event) {
211194
212195} ;
213196
214- ///**
215- // * @deprecated
216- // * @param baseElement
217- // * @param elementToFix
218- // * @returns {boolean }
219- // */
220- //PivotView.prototype.fixSizes = function (baseElement, elementToFix) {
221- //
222- // if (!elementToFix.style) return false;
223- //
224- // for (var i in elementToFix.childNodes) {
225- // //this.fixSizes(baseElement.childNodes[i], elementToFix.childNodes[i]);
226- // }
227- //
228- // if (baseElement["triggerFunction"]) {
229- // elementToFix.addEventListener(
230- // baseElement["triggerFunction"].event,
231- // baseElement["triggerFunction"].trigger
232- // );
233- // }
234- //
235- // var style = window.getComputedStyle(baseElement, null);
236- // elementToFix.style.width = style.getPropertyValue("width");
237- // elementToFix.style.height = style.getPropertyValue("height");
238- //
239- //};
240-
241- ///**
242- // * Create clones of headers with fixed sizes.
243- // *
244- // * @param {HTMLElement } tableElement
245- // * @deprecated
246- // */
247- //PivotView.prototype.fixHeaders = function (tableElement) {
248- //
249- // var fhx, temp, hHead, fhy, c1, c2, d1, d2,
250- // cth = this.tablesStack[this.tablesStack.length - 1]._headers;
251- //
252- // var getChildrenByTagName = function (element, tagName) {
253- // var cls = [];
254- // for (var c in element.childNodes) {
255- // if (element.childNodes[c].tagName === tagName.toUpperCase()) {
256- // cls.push(element.childNodes[c]);
257- // }
258- // }
259- // return cls;
260- // };
261- //
262- // if (!tableElement.parentNode) console.warn("Missing fix headers: before function call to " +
263- // "fixHeaders() table element must be attached to DOM.");
264- //
265- // // clone thead
266- // temp = fhx = getChildrenByTagName(tableElement, "thead")[0];
267- // if (!fhx) {
268- // console.error("Unable to fix headers: no \"thead\" in basic table."); return false;
269- // }
270- // fhx = fhx.cloneNode(true);
271- // fhx.className = "fixedHeader";
272- // fhx.style.zIndex = 2;
273- // cth.h.base = temp;
274- // cth.h.clone = fhx;
275- // this.fixSizes(temp, fhx);
276- // fhx.style.width = "";
277- //
278- // // clone top left corner
279- // hHead = temp.childNodes[0].childNodes[0].cloneNode(true);
280- // cth.c.base = temp.childNodes[0].childNodes[0];
281- // cth.c.clone = hHead;
282- // this.fixSizes(temp.childNodes[0].childNodes[0], hHead);
283- // temp = document.createElement("thead");
284- // temp.appendChild(document.createElement("tr")).appendChild(hHead);
285- // temp.className = "fixedHeader";
286- // temp.style.zIndex = 3;
287- // hHead = temp;
288- //
289- // // clone body headers
290- // temp = fhy = getChildrenByTagName(tableElement, "tbody")[0];
291- // if (!fhy) {
292- // console.error("Unable to fix headers: no \"tbody\" in basic table."); return false;
293- // }
294- // fhy = fhy.cloneNode(false);
295- // fhy.className = "fixedHeader";
296- // fhy.style.top = temp.offsetTop + "px";
297- // c1 = getChildrenByTagName(temp, "tr");
298- // for (var i in c1) {
299- // fhy.appendChild(d1 = c1[i].cloneNode(false));
300- // c2 = getChildrenByTagName(c1[i], "th");
301- // for (var u in c2) {
302- // d1.appendChild(d2 = c2[u].cloneNode(true));
303- // }
304- // }
305- // cth.v.base = temp;
306- // cth.v.clone = fhy;
307- // this.fixSizes(temp, fhy);
308- // fhy.style.width = "";
309- // fhy.style.zIndex = 1;
310- //
311- // // add scroll listener
312- // tableElement.parentNode.addEventListener("scroll", this._scrollListener = function () {
313- // if (!tableElement.parentNode) return; // toFix
314- // hHead.style.top = fhx.style.top = tableElement.parentNode.scrollTop + "px";
315- // hHead.style.left = fhy.style.left = tableElement.parentNode.scrollLeft + "px";
316- // }, false);
317- //
318- // // append new elements
319- // tableElement.appendChild(fhx);
320- // tableElement.appendChild(fhy);
321- // if ((this.controller.dataController.getData() || { dimensions: [0, 0] }).dimensions[1].length) {
322- // tableElement.appendChild(hHead);
323- // }
324- //
325- // // call scroll handler because of render may be performed anytime
326- // this._scrollListener();
327- //
328- //};
329-
330197/**
331198 * Displays text which hovers table. Pass empty string to hide message.
332199 *
@@ -688,190 +555,3 @@ PivotView.prototype.renderRawData = function (data) {
688555 this . recalculateSizes ( container ) ;
689556
690557} ;
691-
692- //PivotView.prototype.renderRawData = function (data) {
693- //
694- // var clickEvent = this.controller.CONFIG["triggerEvent"] || "click";
695- //
696- // if (!data || !data[0] || !data[0][0]) {
697- // this.elements.tableContainer.innerHTML = "<h1>Unable to render data</h1><p>"
698- // + JSON.stringify(data) + "</p>";
699- // return;
700- // }
701- //
702- // if (this._scrollListener) {
703- // this.elements.tableContainer.removeEventListener("scroll", this._scrollListener);
704- // this._scrollListener = null;
705- // }
706- //
707- // var table = document.createElement("table"),
708- // thead = document.createElement("thead"),
709- // tbody = document.createElement("tbody"),
710- // timeToBreak = false,
711- // _ = this,
712- // x, y, tr, td,
713- // headColsNum = 0, headLeftColsNum = 0,
714- // headRowsNum = 0, headLeftRowsNum = 0;
715- //
716- // var addTrigger = function (element, event, trigger) {
717- //
718- // element["triggerFunction"] = {
719- // event: event,
720- // trigger: trigger
721- // };
722- //
723- // element.addEventListener(event, trigger);
724- //
725- // };
726- //
727- // // compute headColsNum & headLeftColsNum
728- // for (y = 0; y < data.length; y++) {
729- // for (x = 0; x < data[y].length; x++) {
730- // if (!data[y][x].isCaption) {
731- // timeToBreak = true;
732- // break;
733- // }
734- // }
735- // if (timeToBreak) {
736- // headLeftColsNum = x;
737- // break;
738- // } else headColsNum++;
739- // }
740- //
741- // // compute headRowsNum & headLeftRowsNum
742- // for (y = 0; y < data.length; y++) {
743- // if (!data[y][data[y].length - 1].isCaption) {
744- // headRowsNum = y;
745- // headLeftRowsNum = data.length - y;
746- // break;
747- // }
748- // }
749- //
750- // for (y = 0; y < data.length; y++) {
751- // tr = document.createElement("tr");
752- // for (x = 0; x < data[y].length; x++) {
753- // if (data[y][x].group) {
754- // if ((y > 0 && data[y - 1][x].group
755- // && data[y - 1][x].group === data[y][x].group)
756- // || (x > 0 && data[y][x - 1].group
757- // && data[y][x - 1].group === data[y][x].group)) {
758- //
759- // td = null;
760- //
761- // } else {
762- //
763- // td = document.createElement(data[y][x].isCaption ? "th" : "td");
764- // td.colSpan = (function (g) {
765- // var i;
766- // for (i = x; i < data[y].length; i++) {
767- // if (data[y][i].group !== g) break;
768- // }
769- // return i - x;
770- // })(data[y][x].group);
771- // td.rowSpan = (function (g) {
772- // var i;
773- // for (i = y; i < data.length; i++) {
774- // if (data[i][x].group !== g) break;
775- // }
776- // return i - y;
777- // })(data[y][x].group);
778- //
779- // if (!_.controller.CONFIG["hideButtons"] && x === 0 && y === 0
780- // && _.tablesStack.length > 1) {
781- // var elt = document.createElement("div");
782- // elt.className = "backButton";
783- // addTrigger(elt, clickEvent, function (event) {
784- // _._backClickHandler.call(_, event);
785- // });
786- // td.insertBefore(elt, td.childNodes[td.childNodes.length - 1] || null);
787- // }
788- //
789- // }
790- // } else {
791- // td = document.createElement(data[y][x].isCaption ? "th" : "td");
792- // }
793- //
794- // // add _columnClickHandler to last rows of th's
795- // if (td && x >= headLeftColsNum && y === headColsNum - 1) {
796- // // clickable cells (sort option)
797- // (function (x) {
798- // addTrigger(td, clickEvent, function () {
799- // var colNum = x - headLeftColsNum;
800- // _._columnClickHandler.call(_, colNum);
801- // });
802- // })(x);
803- // }
804- //
805- // // add _rowClickHandler to th's last column
806- // if (td && x === headLeftColsNum - 1 && y >= headRowsNum) {
807- // (function (y, x) {
808- // addTrigger(td, clickEvent, function () {
809- // var rowNum = y - headRowsNum;
810- // _._rowClickHandler.call(_, rowNum, data[y][x]);
811- // });
812- // })(y, x);
813- // }
814- //
815- // if (td) {
816- // var span = document.createElement("span");
817- // if (!isFinite(data[y][x].value)) {
818- // if (!data[y][x].value.toString().match(/[0-9],?[0-9]?%/i))
819- // td.className = "formatLeft";
820- // }
821- // if (data[y][x].style) {
822- // td.setAttribute("style", data[y][x].style);
823- // }
824- // td.appendChild(span);
825- // tr.appendChild(td);
826- // if (x >= headLeftColsNum && y >= headRowsNum) {
827- //
828- // if (this.controller.CONFIG["formatNumbers"] && data[y][x].value
829- // && isFinite(data[y][x].value)) {
830- // span.textContent = this.formatNumber(
831- // this.controller.CONFIG["formatNumbers"],
832- // data[y][x].value
833- // );
834- // } else {
835- // if (Number(data[y][x].value) === data[y][x].value) { // if number
836- // // perform default formatting
837- // if (data[y][x].value % 1 === 0) { // if integer
838- // span.textContent =
839- // this.formatNumber("#,###,###.##", data[y][x].value)
840- // .replace(/\..*/, "");
841- // } else { // if float
842- // span.textContent = this.formatNumber("#,###,###.##", data[y][x].value);
843- // }
844- // } else {
845- // span.textContent = data[y][x].value;
846- // }
847- // }
848- //
849- // (function (x, y) {addTrigger(td, clickEvent, function (event) {
850- // _._cellClickHandler.call(_, x, y, event);
851- // }) })(x, y);
852- // } else {
853- // span.textContent = data[y][x].value;
854- // }
855- // }
856- //
857- // if (!_.controller.CONFIG["hideButtons"] && x === 0 && y === 0
858- // && _.controller.dataController.getData().info.action === "MDX") {
859- // var element = document.createElement("div");
860- // element.className = "drillDownIcon";
861- // addTrigger(element, clickEvent, function (event) {
862- // _._drillThroughClickHandler.call(_, event);
863- // });
864- // td.insertBefore(element, td.childNodes[td.childNodes.length - 1] || null);
865- // }
866- //
867- // }
868- // (y < headColsNum ? thead : tbody).appendChild(tr);
869- // }
870- //
871- // table.appendChild(thead);
872- // table.appendChild(tbody);
873- // this.elements.tableContainer.textContent = "";
874- // this.elements.tableContainer.appendChild(table);
875- // this.fixHeaders(table);
876- //
877- //};
0 commit comments