a:59:{s:9:"#provides";s:19:"dojox.grid._Builder";s:9:"#resource";s:16:"grid/_Builder.js";s:9:"#requires";a:2:{i:0;a:2:{i:0;s:6:"common";i:1;s:15:"dojox.grid.util";}i:1;a:3:{i:0;s:6:"common";i:1;s:17:"dojo.dnd.Moveable";i:2;s:4:"dojo";}}s:19:"dojox.grid._Builder";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"view";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:62:" if(view){ this.view = view; this.grid = view.grid; }";s:9:"classlike";b:1;s:7:"summary";s:0:"";}s:26:"dojox.grid._ContentBuilder";a:7:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"view";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:31:" dg._Builder.call(this, view);";s:6:"chains";a:1:{s:4:"call";a:1:{i:0;s:11:"dg._Builder";}}s:6:"mixins";a:1:{s:9:"prototype";a:1:{i:0;s:21:"dg._Builder.prototype";}}s:9:"classlike";b:1;s:7:"summary";s:0:"";}s:25:"dojox.grid._HeaderBuilder";a:7:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"view";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:55:" this.moveable = null; dg._Builder.call(this, view);";s:6:"chains";a:1:{s:4:"call";a:1:{i:0;s:11:"dg._Builder";}}s:6:"mixins";a:1:{s:9:"prototype";a:1:{i:0;s:21:"dg._Builder.prototype";}}s:9:"classlike";b:1;s:7:"summary";s:0:"";}s:20:"dojox.grid._TableMap";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"rows";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:21:" this.mapRows(rows);";s:9:"classlike";b:1;s:7:"summary";s:0:"";}s:24:"dojox.grid._Builder.view";a:3:{s:8:"instance";s:19:"dojox.grid._Builder";s:9:"prototype";s:19:"dojox.grid._Builder";s:7:"summary";s:0:"";}s:24:"dojox.grid._Builder.grid";a:2:{s:8:"instance";s:19:"dojox.grid._Builder";s:7:"summary";s:0:"";}s:26:"dojox.grid._Builder._table";a:3:{s:9:"prototype";s:19:"dojox.grid._Builder";s:7:"private";b:1;s:7:"summary";s:0:"";}s:33:"dojox.grid._Builder.getTableArray";a:4:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:6:"source";s:167:" var html = [this._table]; if(this.view.viewWidth){ html.push([' style="width:', this.view.viewWidth, ';"'].join('')); } html.push('>'); return html;";s:7:"summary";s:0:"";}s:38:"dojox.grid._Builder.generateCellMarkup";a:6:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:4:{s:6:"inCell";a:1:{s:4:"type";s:0:"";}s:12:"inMoreStyles";a:1:{s:4:"type";s:0:"";}s:13:"inMoreClasses";a:1:{s:4:"type";s:0:"";}s:8:"isHeader";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:1507:" var result = [], html; var waiPrefix = dojo.isFF<3 ? "wairole:" : ""; if(isHeader){ var sortInfo = inCell.index != inCell.grid.getSortIndex() ? "" : inCell.grid.sortInfo > 0 ? 'aria-sort="ascending"' : 'aria-sort="descending"'; html = [''); // result[4] => td postfix result.push(html.join('')); // SLOT: result[5] => content result.push(''); // result[6] => td closes result.push(isHeader?'':''); return result; // Array";s:7:"returns";s:5:"Array";s:7:"summary";s:0:"";}s:30:"dojox.grid._Builder.isCellNode";a:5:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"inNode";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:74:" return Boolean(inNode && inNode!=dojo.doc && dojo.attr(inNode, "idx"));";s:7:"summary";s:0:"";}s:36:"dojox.grid._Builder.getCellNodeIndex";a:5:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:10:"inCellNode";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:65:" return inCellNode ? Number(dojo.attr(inCellNode, "idx")) : -1;";s:7:"summary";s:0:"";}s:31:"dojox.grid._Builder.getCellNode";a:5:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:9:"inRowNode";a:1:{s:4:"type";s:0:"";}s:11:"inCellIndex";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:200:" for(var i=0, row; row=getTr(inRowNode.firstChild, i); i++){ for(var j=0, cell; cell=row.cells[j]; j++){ if(this.getCellNodeIndex(cell) == inCellIndex){ return cell; } } }";s:7:"summary";s:0:"";}s:34:"dojox.grid._Builder.findCellTarget";a:5:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:12:"inSourceNode";a:1:{s:4:"type";s:0:"";}s:9:"inTopNode";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:264:" var n = inSourceNode; while(n && (!this.isCellNode(n) || (n.offsetParent && gridViewTag in n.offsetParent.parentNode && n.offsetParent.parentNode[gridViewTag] != this.view.id)) && (n!=inTopNode)){ n = n.parentNode; } return n!=inTopNode ? n : null ";s:7:"summary";s:0:"";}s:37:"dojox.grid._Builder.baseDecorateEvent";a:5:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:264:" e.dispatch = 'do' + e.type; e.grid = this.grid; e.sourceView = this.view; e.cellNode = this.findCellTarget(e.target, e.rowNode); e.cellIndex = this.getCellNodeIndex(e.cellNode); e.cell = (e.cellIndex >= 0 ? this.grid.getCell(e.cellIndex) : null);";s:7:"summary";s:0:"";}s:30:"dojox.grid._Builder.findTarget";a:5:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:8:"inSource";a:1:{s:4:"type";s:0:"";}s:5:"inTag";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:199:" var n = inSource; while(n && (n!=this.domNode) && (!(inTag in n) || (gridViewTag in n && n[gridViewTag] != this.view.id))){ n = n.parentNode; } return (n != this.domNode) ? n : null; ";s:7:"summary";s:0:"";}s:33:"dojox.grid._Builder.findRowTarget";a:5:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:8:"inSource";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:49:" return this.findTarget(inSource, rowIndexTag);";s:7:"summary";s:0:"";}s:36:"dojox.grid._Builder.isIntraNodeEvent";a:5:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:260:" try{ return (e.cellNode && e.relatedTarget && dojo.isDescendant(e.relatedTarget, e.cellNode)); }catch(x){ // e.relatedTarget has permission problem in FF if it's an input: https://bugzilla.mozilla.org/show_bug.cgi?id=208427 return false; }";s:7:"summary";s:0:"";}s:35:"dojox.grid._Builder.isIntraRowEvent";a:5:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:309:" try{ var row = e.relatedTarget && this.findRowTarget(e.relatedTarget); return !row && (e.rowIndex==-1) || row && (e.rowIndex==row.gridRowIndex); }catch(x){ // e.relatedTarget on INPUT has permission problem in FF: https://bugzilla.mozilla.org/show_bug.cgi?id=208427 return false; }";s:7:"summary";s:0:"";}s:33:"dojox.grid._Builder.dispatchEvent";a:5:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:63:" if(e.dispatch in this){ return this[e.dispatch](e); }";s:7:"summary";s:0:"";}s:31:"dojox.grid._Builder.domouseover";a:5:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:164:" if(e.cellNode && (e.cellNode!=this.lastOverCellNode)){ this.lastOverCellNode = e.cellNode; this.grid.onMouseOver(e); } this.grid.onMouseOverRow(e);";s:7:"summary";s:0:"";}s:36:"dojox.grid._Builder.lastOverCellNode";a:2:{s:8:"instance";s:19:"dojox.grid._Builder";s:7:"summary";s:0:"";}s:30:"dojox.grid._Builder.domouseout";a:5:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:250:" if(e.cellNode && (e.cellNode==this.lastOverCellNode) && !this.isIntraNodeEvent(e, this.lastOverCellNode)){ this.lastOverCellNode = null; this.grid.onMouseOut(e); if(!this.isIntraRowEvent(e)){ this.grid.onMouseOutRow(e); } }";s:7:"summary";s:0:"";}s:31:"dojox.grid._Builder.domousedown";a:5:{s:9:"prototype";s:19:"dojox.grid._Builder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:79:" if (e.cellNode) this.grid.onMouseDown(e); this.grid.onMouseDownRow(e)";s:7:"summary";s:0:"";}s:33:"dojox.grid._ContentBuilder.update";a:4:{s:9:"prototype";s:26:"dojox.grid._ContentBuilder";s:4:"type";s:8:"Function";s:6:"source";s:22:" this.prepareHtml();";s:7:"summary";s:0:"";}s:38:"dojox.grid._ContentBuilder.prepareHtml";a:4:{s:9:"prototype";s:26:"dojox.grid._ContentBuilder";s:4:"type";s:8:"Function";s:6:"source";s:324:" var defaultGet=this.grid.get, cells=this.view.structure.cells; for(var j=0, row; (row=cells[j]); j++){ for(var i=0, cell; (cell=row[i]); i++){ cell.get = cell.get || (cell.value == undefined) && defaultGet; cell.markup = this.generateCellMarkup(cell, cell.cellStyles, cell.cellClasses, false); } }";s:7:"summary";s:0:"";}s:39:"dojox.grid._ContentBuilder.generateHtml";a:7:{s:9:"prototype";s:26:"dojox.grid._ContentBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:11:"inDataIndex";a:1:{s:4:"type";s:0:"";}s:10:"inRowIndex";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:855:" var html = this.getTableArray(), v = this.view, cells = v.structure.cells, item = this.grid.getItem(inRowIndex); dojox.grid.util.fire(this.view, "onBeforeRow", [inRowIndex, cells]); for(var j=0, row; (row=cells[j]); j++){ if(row.hidden || row.header){ continue; } html.push(!row.invisible ? '' : ''); for(var i=0, cell, m, cc, cs; (cell=row[i]); i++){ m = cell.markup, cc = cell.customClasses = [], cs = cell.customStyles = []; // content (format can fill in cc and cs as side-effects) m[5] = cell.format(inRowIndex, item); // classes m[1] = cc.join(' '); // styles m[3] = cs.join(';'); // in-place concat html.push.apply(html, m); } html.push(''); } html.push(''); return html.join(''); // String";s:7:"returns";s:6:"String";s:6:"chains";a:1:{s:4:"call";a:1:{i:0;s:9:"html.push";}}s:7:"summary";s:0:"";}s:40:"dojox.grid._ContentBuilder.decorateEvent";a:6:{s:9:"prototype";s:26:"dojox.grid._ContentBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:218:" e.rowNode = this.findRowTarget(e.target); if(!e.rowNode){return false}; e.rowIndex = e.rowNode[rowIndexTag]; this.baseDecorateEvent(e); e.cell = this.grid.getCell(e.cellIndex); return true; // Boolean";s:7:"returns";s:7:"Boolean";s:7:"summary";s:0:"";}s:34:"dojox.grid._HeaderBuilder.moveable";a:2:{s:8:"instance";s:25:"dojox.grid._HeaderBuilder";s:7:"summary";s:0:"";}s:42:"dojox.grid._HeaderBuilder._skipBogusClicks";a:4:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:8:"instance";s:25:"dojox.grid._HeaderBuilder";s:7:"private";b:1;s:7:"summary";s:0:"";}s:41:"dojox.grid._HeaderBuilder.overResizeWidth";a:2:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:7:"summary";s:0:"";}s:37:"dojox.grid._HeaderBuilder.minColWidth";a:2:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:7:"summary";s:0:"";}s:32:"dojox.grid._HeaderBuilder.update";a:4:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:6:"source";s:155:" if(this.tableMap){ this.tableMap.mapRows(this.view.structure.cells); }else{ this.tableMap = new dg._TableMap(this.view.structure.cells); }";s:7:"summary";s:0:"";}s:34:"dojox.grid._HeaderBuilder.tableMap";a:2:{s:8:"instance";s:25:"dojox.grid._HeaderBuilder";s:7:"summary";s:0:"";}s:38:"dojox.grid._HeaderBuilder.generateHtml";a:5:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:10:"inGetValue";a:1:{s:4:"type";s:0:"";}s:7:"inValue";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:1383:" var html = this.getTableArray(), cells = this.view.structure.cells; dojox.grid.util.fire(this.view, "onBeforeRow", [-1, cells]); for(var j=0, row; (row=cells[j]); j++){ if(row.hidden){ continue; } html.push(!row.invisible ? '' : ''); for(var i=0, cell, markup; (cell=row[i]); i++){ cell.customClasses = []; cell.customStyles = []; if(this.view.simpleStructure){ if(cell.headerClasses){ if(cell.headerClasses.indexOf('dojoDndItem') == -1){ cell.headerClasses += ' dojoDndItem'; } }else{ cell.headerClasses = 'dojoDndItem'; } if(cell.attrs){ if(cell.attrs.indexOf("dndType='gridColumn_") == -1){ cell.attrs += " dndType='gridColumn_" + this.grid.id + "'"; } }else{ cell.attrs = "dndType='gridColumn_" + this.grid.id + "'"; } } markup = this.generateCellMarkup(cell, cell.headerStyles, cell.headerClasses, true); // content markup[5] = (inValue != undefined ? inValue : inGetValue(cell)); // styles markup[3] = cell.customStyles.join(';'); // classes markup[1] = cell.customClasses.join(' '); //(cell.customClasses ? ' ' + cell.customClasses : ''); html.push(markup.join('')); } html.push(''); } html.push(''); return html.join('');";s:7:"summary";s:0:"";}s:34:"dojox.grid._HeaderBuilder.getCellX";a:5:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:736:" var x = e.layerX; if(dojo.isMoz){ var n = ascendDom(e.target, makeNotTagName("th")); x -= (n && n.offsetLeft) || 0; var t = e.sourceView.getScrollbarWidth(); if(!dojo._isBodyLtr() && e.sourceView.headerNode.scrollLeft < t) x -= t; //x -= getProp(ascendDom(e.target, mkNotTagName("td")), "offsetLeft") || 0; } var n = ascendDom(e.target, function(){ if(!n || n == e.cellNode){ return false; } // Mozilla 1.8 (FF 1.5) has a bug that makes offsetLeft = -parent border width // when parent has border, overflow: hidden, and is positioned // handle this problem here ... not a general solution! x += (n.offsetLeft < 0 ? 0 : n.offsetLeft); return true; }); return x;";s:7:"summary";s:0:"";}s:39:"dojox.grid._HeaderBuilder.decorateEvent";a:5:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:96:" this.baseDecorateEvent(e); e.rowIndex = -1; e.cellX = this.getCellX(e); return true;";s:7:"summary";s:0:"";}s:39:"dojox.grid._HeaderBuilder.prepareResize";a:5:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:1:"e";a:1:{s:4:"type";s:0:"";}s:3:"mod";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:273:" do{ var i = getTdIndex(e.cellNode); e.cellNode = (i ? e.cellNode.parentNode.cells[i+mod] : null); e.cellIndex = (e.cellNode ? this.getCellNodeIndex(e.cellNode) : -1); }while(e.cellNode && e.cellNode.style.display == "none"); return Boolean(e.cellNode);";s:7:"summary";s:0:"";}s:35:"dojox.grid._HeaderBuilder.canResize";a:5:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:161:" if(!e.cellNode || e.cellNode.colSpan > 1){ return false; } var cell = this.grid.getCell(e.cellIndex); return !cell.noresize && cell.canResize();";s:7:"summary";s:0:"";}s:44:"dojox.grid._HeaderBuilder.overLeftResizeArea";a:6:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:12383:"dojo.provide("dojox.grid._Builder"); dojo.require("dojox.grid.util"); dojo.require("dojo.dnd.Moveable"); (function(){ var dg = dojox.grid; var getTdIndex = function(td){ return td.cellIndex >=0 ? td.cellIndex : dojo.indexOf(td.parentNode.cells, td); }; var getTrIndex = function(tr){ return tr.rowIndex >=0 ? tr.rowIndex : dojo.indexOf(tr.parentNode.childNodes, tr); }; var getTr = function(rowOwner, index){ return rowOwner && ((rowOwner.rows||0)[index] || rowOwner.childNodes[index]); }; var findTable = function(node){ for(var n=node; n && n.tagName!='TABLE'; n=n.parentNode); return n; }; var ascendDom = function(inNode, inWhile){ for(var n=inNode; n && inWhile(n); n=n.parentNode); return n; }; var makeNotTagName = function(inTagName){ var name = inTagName.toUpperCase(); return function(node){ return node.tagName != name; }; }; var rowIndexTag = dojox.grid.util.rowIndexTag; var gridViewTag = dojox.grid.util.gridViewTag; // base class for generating markup for the views dg._Builder = dojo.extend(function(view){ if(view){ this.view = view; this.grid = view.grid; } },{ view: null, // boilerplate HTML _table: ''); return html; }, // generate starting tags for a cell generateCellMarkup: function(inCell, inMoreStyles, inMoreClasses, isHeader){ var result = [], html; var waiPrefix = dojo.isFF<3 ? "wairole:" : ""; if(isHeader){ var sortInfo = inCell.index != inCell.grid.getSortIndex() ? "" : inCell.grid.sortInfo > 0 ? 'aria-sort="ascending"' : 'aria-sort="descending"'; html = ['':''); return result; // Array }, // cell finding isCellNode: function(inNode){ return Boolean(inNode && inNode!=dojo.doc && dojo.attr(inNode, "idx")); }, getCellNodeIndex: function(inCellNode){ return inCellNode ? Number(dojo.attr(inCellNode, "idx")) : -1; }, getCellNode: function(inRowNode, inCellIndex){ for(var i=0, row; row=getTr(inRowNode.firstChild, i); i++){ for(var j=0, cell; cell=row.cells[j]; j++){ if(this.getCellNodeIndex(cell) == inCellIndex){ return cell; } } } }, findCellTarget: function(inSourceNode, inTopNode){ var n = inSourceNode; while(n && (!this.isCellNode(n) || (n.offsetParent && gridViewTag in n.offsetParent.parentNode && n.offsetParent.parentNode[gridViewTag] != this.view.id)) && (n!=inTopNode)){ n = n.parentNode; } return n!=inTopNode ? n : null }, // event decoration baseDecorateEvent: function(e){ e.dispatch = 'do' + e.type; e.grid = this.grid; e.sourceView = this.view; e.cellNode = this.findCellTarget(e.target, e.rowNode); e.cellIndex = this.getCellNodeIndex(e.cellNode); e.cell = (e.cellIndex >= 0 ? this.grid.getCell(e.cellIndex) : null); }, // event dispatch findTarget: function(inSource, inTag){ var n = inSource; while(n && (n!=this.domNode) && (!(inTag in n) || (gridViewTag in n && n[gridViewTag] != this.view.id))){ n = n.parentNode; } return (n != this.domNode) ? n : null; }, findRowTarget: function(inSource){ return this.findTarget(inSource, rowIndexTag); }, isIntraNodeEvent: function(e){ try{ return (e.cellNode && e.relatedTarget && dojo.isDescendant(e.relatedTarget, e.cellNode)); }catch(x){ // e.relatedTarget has permission problem in FF if it's an input: https://bugzilla.mozilla.org/show_bug.cgi?id=208427 return false; } }, isIntraRowEvent: function(e){ try{ var row = e.relatedTarget && this.findRowTarget(e.relatedTarget); return !row && (e.rowIndex==-1) || row && (e.rowIndex==row.gridRowIndex); }catch(x){ // e.relatedTarget on INPUT has permission problem in FF: https://bugzilla.mozilla.org/show_bug.cgi?id=208427 return false; } }, dispatchEvent: function(e){ if(e.dispatch in this){ return this[e.dispatch](e); } }, // dispatched event handlers domouseover: function(e){ if(e.cellNode && (e.cellNode!=this.lastOverCellNode)){ this.lastOverCellNode = e.cellNode; this.grid.onMouseOver(e); } this.grid.onMouseOverRow(e); }, domouseout: function(e){ if(e.cellNode && (e.cellNode==this.lastOverCellNode) && !this.isIntraNodeEvent(e, this.lastOverCellNode)){ this.lastOverCellNode = null; this.grid.onMouseOut(e); if(!this.isIntraRowEvent(e)){ this.grid.onMouseOutRow(e); } } }, domousedown: function(e){ if (e.cellNode) this.grid.onMouseDown(e); this.grid.onMouseDownRow(e) } }); // Produces html for grid data content. Owned by grid and used internally // for rendering data. Override to implement custom rendering. dg._ContentBuilder = dojo.extend(function(view){ dg._Builder.call(this, view); },dg._Builder.prototype,{ update: function(){ this.prepareHtml(); }, // cache html for rendering data rows prepareHtml: function(){ var defaultGet=this.grid.get, cells=this.view.structure.cells; for(var j=0, row; (row=cells[j]); j++){ for(var i=0, cell; (cell=row[i]); i++){ cell.get = cell.get || (cell.value == undefined) && defaultGet; cell.markup = this.generateCellMarkup(cell, cell.cellStyles, cell.cellClasses, false); } } }, // time critical: generate html using cache and data source generateHtml: function(inDataIndex, inRowIndex){ var html = this.getTableArray(), v = this.view, cells = v.structure.cells, item = this.grid.getItem(inRowIndex); dojox.grid.util.fire(this.view, "onBeforeRow", [inRowIndex, cells]); for(var j=0, row; (row=cells[j]); j++){ if(row.hidden || row.header){ continue; } html.push(!row.invisible ? '' : ''); for(var i=0, cell, m, cc, cs; (cell=row[i]); i++){ m = cell.markup, cc = cell.customClasses = [], cs = cell.customStyles = []; // content (format can fill in cc and cs as side-effects) m[5] = cell.format(inRowIndex, item); // classes m[1] = cc.join(' '); // styles m[3] = cs.join(';'); // in-place concat html.push.apply(html, m); } html.push(''); } html.push('
'); // result[4] => td postfix result.push(html.join('')); // SLOT: result[5] => content result.push(''); // result[6] => td closes result.push(isHeader?'
'); return html.join(''); // String }, decorateEvent: function(e){ e.rowNode = this.findRowTarget(e.target); if(!e.rowNode){return false}; e.rowIndex = e.rowNode[rowIndexTag]; this.baseDecorateEvent(e); e.cell = this.grid.getCell(e.cellIndex); return true; // Boolean } }); // Produces html for grid header content. Owned by grid and used internally // for rendering data. Override to implement custom rendering. dg._HeaderBuilder = dojo.extend(function(view){ this.moveable = null; dg._Builder.call(this, view); },dg._Builder.prototype,{ _skipBogusClicks: false, overResizeWidth: 4, minColWidth: 1, update: function(){ if(this.tableMap){ this.tableMap.mapRows(this.view.structure.cells); }else{ this.tableMap = new dg._TableMap(this.view.structure.cells); } }, generateHtml: function(inGetValue, inValue){ var html = this.getTableArray(), cells = this.view.structure.cells; dojox.grid.util.fire(this.view, "onBeforeRow", [-1, cells]); for(var j=0, row; (row=cells[j]); j++){ if(row.hidden){ continue; } html.push(!row.invisible ? '' : ''); for(var i=0, cell, markup; (cell=row[i]); i++){ cell.customClasses = []; cell.customStyles = []; if(this.view.simpleStructure){ if(cell.headerClasses){ if(cell.headerClasses.indexOf('dojoDndItem') == -1){ cell.headerClasses += ' dojoDndItem'; } }else{ cell.headerClasses = 'dojoDndItem'; } if(cell.attrs){ if(cell.attrs.indexOf("dndType='gridColumn_") == -1){ cell.attrs += " dndType='gridColumn_" + this.grid.id + "'"; } }else{ cell.attrs = "dndType='gridColumn_" + this.grid.id + "'"; } } markup = this.generateCellMarkup(cell, cell.headerStyles, cell.headerClasses, true); // content markup[5] = (inValue != undefined ? inValue : inGetValue(cell)); // styles markup[3] = cell.customStyles.join(';'); // classes markup[1] = cell.customClasses.join(' '); //(cell.customClasses ? ' ' + cell.customClasses : ''); html.push(markup.join('')); } html.push(''); } html.push(''); return html.join(''); }, // event helpers getCellX: function(e){ var x = e.layerX; if(dojo.isMoz){ var n = ascendDom(e.target, makeNotTagName("th")); x -= (n && n.offsetLeft) || 0; var t = e.sourceView.getScrollbarWidth(); if(!dojo._isBodyLtr() && e.sourceView.headerNode.scrollLeft < t) x -= t; //x -= getProp(ascendDom(e.target, mkNotTagName("td")), "offsetLeft") || 0; } var n = ascendDom(e.target, function(){ if(!n || n == e.cellNode){ return false; } // Mozilla 1.8 (FF 1.5) has a bug that makes offsetLeft = -parent border width // when parent has border, overflow: hidden, and is positioned // handle this problem here ... not a general solution! x += (n.offsetLeft < 0 ? 0 : n.offsetLeft); return true; }); return x; }, // event decoration decorateEvent: function(e){ this.baseDecorateEvent(e); e.rowIndex = -1; e.cellX = this.getCellX(e); return true; }, // event handlers // resizing prepareResize: function(e, mod){ do{ var i = getTdIndex(e.cellNode); e.cellNode = (i ? e.cellNode.parentNode.cells[i+mod] : null); e.cellIndex = (e.cellNode ? this.getCellNodeIndex(e.cellNode) : -1); }while(e.cellNode && e.cellNode.style.display == "none"); return Boolean(e.cellNode); }, canResize: function(e){ if(!e.cellNode || e.cellNode.colSpan > 1){ return false; } var cell = this.grid.getCell(e.cellIndex); return !cell.noresize && cell.canResize(); }, overLeftResizeArea: function(e){ //Bugfix for crazy IE problem (#8807). IE returns position information for the icon and text arrow divs //as if they were still on the left instead of returning the position they were 'float: right' to. //So, the resize check ends up checking the wrong adjacent cell. This checks to see if the hover was over //the image or text nodes, then just ignored them/treat them not in scale range. if(dojo.isIE){ var tN = e.target; if(dojo.hasClass(tN, "dojoxGridArrowButtonNode") || dojo.hasClass(tN, "dojoxGridArrowButtonChar")){ return false; } } if(dojo._isBodyLtr()){ return (e.cellIndex>0) && (e.cellX < this.overResizeWidth) && this.prepareResize(e, -1); } var t = e.cellNode && (e.cellX < this.overResizeWidth); return t;";s:7:"returns";s:20:"Array|String|Boolean";s:7:"summary";s:0:"";}s:45:"dojox.grid._HeaderBuilder.overRightResizeArea";a:6:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:13248:"dojo.provide("dojox.grid._Builder"); dojo.require("dojox.grid.util"); dojo.require("dojo.dnd.Moveable"); (function(){ var dg = dojox.grid; var getTdIndex = function(td){ return td.cellIndex >=0 ? td.cellIndex : dojo.indexOf(td.parentNode.cells, td); }; var getTrIndex = function(tr){ return tr.rowIndex >=0 ? tr.rowIndex : dojo.indexOf(tr.parentNode.childNodes, tr); }; var getTr = function(rowOwner, index){ return rowOwner && ((rowOwner.rows||0)[index] || rowOwner.childNodes[index]); }; var findTable = function(node){ for(var n=node; n && n.tagName!='TABLE'; n=n.parentNode); return n; }; var ascendDom = function(inNode, inWhile){ for(var n=inNode; n && inWhile(n); n=n.parentNode); return n; }; var makeNotTagName = function(inTagName){ var name = inTagName.toUpperCase(); return function(node){ return node.tagName != name; }; }; var rowIndexTag = dojox.grid.util.rowIndexTag; var gridViewTag = dojox.grid.util.gridViewTag; // base class for generating markup for the views dg._Builder = dojo.extend(function(view){ if(view){ this.view = view; this.grid = view.grid; } },{ view: null, // boilerplate HTML _table: ''); return html; }, // generate starting tags for a cell generateCellMarkup: function(inCell, inMoreStyles, inMoreClasses, isHeader){ var result = [], html; var waiPrefix = dojo.isFF<3 ? "wairole:" : ""; if(isHeader){ var sortInfo = inCell.index != inCell.grid.getSortIndex() ? "" : inCell.grid.sortInfo > 0 ? 'aria-sort="ascending"' : 'aria-sort="descending"'; html = ['':''); return result; // Array }, // cell finding isCellNode: function(inNode){ return Boolean(inNode && inNode!=dojo.doc && dojo.attr(inNode, "idx")); }, getCellNodeIndex: function(inCellNode){ return inCellNode ? Number(dojo.attr(inCellNode, "idx")) : -1; }, getCellNode: function(inRowNode, inCellIndex){ for(var i=0, row; row=getTr(inRowNode.firstChild, i); i++){ for(var j=0, cell; cell=row.cells[j]; j++){ if(this.getCellNodeIndex(cell) == inCellIndex){ return cell; } } } }, findCellTarget: function(inSourceNode, inTopNode){ var n = inSourceNode; while(n && (!this.isCellNode(n) || (n.offsetParent && gridViewTag in n.offsetParent.parentNode && n.offsetParent.parentNode[gridViewTag] != this.view.id)) && (n!=inTopNode)){ n = n.parentNode; } return n!=inTopNode ? n : null }, // event decoration baseDecorateEvent: function(e){ e.dispatch = 'do' + e.type; e.grid = this.grid; e.sourceView = this.view; e.cellNode = this.findCellTarget(e.target, e.rowNode); e.cellIndex = this.getCellNodeIndex(e.cellNode); e.cell = (e.cellIndex >= 0 ? this.grid.getCell(e.cellIndex) : null); }, // event dispatch findTarget: function(inSource, inTag){ var n = inSource; while(n && (n!=this.domNode) && (!(inTag in n) || (gridViewTag in n && n[gridViewTag] != this.view.id))){ n = n.parentNode; } return (n != this.domNode) ? n : null; }, findRowTarget: function(inSource){ return this.findTarget(inSource, rowIndexTag); }, isIntraNodeEvent: function(e){ try{ return (e.cellNode && e.relatedTarget && dojo.isDescendant(e.relatedTarget, e.cellNode)); }catch(x){ // e.relatedTarget has permission problem in FF if it's an input: https://bugzilla.mozilla.org/show_bug.cgi?id=208427 return false; } }, isIntraRowEvent: function(e){ try{ var row = e.relatedTarget && this.findRowTarget(e.relatedTarget); return !row && (e.rowIndex==-1) || row && (e.rowIndex==row.gridRowIndex); }catch(x){ // e.relatedTarget on INPUT has permission problem in FF: https://bugzilla.mozilla.org/show_bug.cgi?id=208427 return false; } }, dispatchEvent: function(e){ if(e.dispatch in this){ return this[e.dispatch](e); } }, // dispatched event handlers domouseover: function(e){ if(e.cellNode && (e.cellNode!=this.lastOverCellNode)){ this.lastOverCellNode = e.cellNode; this.grid.onMouseOver(e); } this.grid.onMouseOverRow(e); }, domouseout: function(e){ if(e.cellNode && (e.cellNode==this.lastOverCellNode) && !this.isIntraNodeEvent(e, this.lastOverCellNode)){ this.lastOverCellNode = null; this.grid.onMouseOut(e); if(!this.isIntraRowEvent(e)){ this.grid.onMouseOutRow(e); } } }, domousedown: function(e){ if (e.cellNode) this.grid.onMouseDown(e); this.grid.onMouseDownRow(e) } }); // Produces html for grid data content. Owned by grid and used internally // for rendering data. Override to implement custom rendering. dg._ContentBuilder = dojo.extend(function(view){ dg._Builder.call(this, view); },dg._Builder.prototype,{ update: function(){ this.prepareHtml(); }, // cache html for rendering data rows prepareHtml: function(){ var defaultGet=this.grid.get, cells=this.view.structure.cells; for(var j=0, row; (row=cells[j]); j++){ for(var i=0, cell; (cell=row[i]); i++){ cell.get = cell.get || (cell.value == undefined) && defaultGet; cell.markup = this.generateCellMarkup(cell, cell.cellStyles, cell.cellClasses, false); } } }, // time critical: generate html using cache and data source generateHtml: function(inDataIndex, inRowIndex){ var html = this.getTableArray(), v = this.view, cells = v.structure.cells, item = this.grid.getItem(inRowIndex); dojox.grid.util.fire(this.view, "onBeforeRow", [inRowIndex, cells]); for(var j=0, row; (row=cells[j]); j++){ if(row.hidden || row.header){ continue; } html.push(!row.invisible ? '' : ''); for(var i=0, cell, m, cc, cs; (cell=row[i]); i++){ m = cell.markup, cc = cell.customClasses = [], cs = cell.customStyles = []; // content (format can fill in cc and cs as side-effects) m[5] = cell.format(inRowIndex, item); // classes m[1] = cc.join(' '); // styles m[3] = cs.join(';'); // in-place concat html.push.apply(html, m); } html.push(''); } html.push('
'); // result[4] => td postfix result.push(html.join('')); // SLOT: result[5] => content result.push(''); // result[6] => td closes result.push(isHeader?'
'); return html.join(''); // String }, decorateEvent: function(e){ e.rowNode = this.findRowTarget(e.target); if(!e.rowNode){return false}; e.rowIndex = e.rowNode[rowIndexTag]; this.baseDecorateEvent(e); e.cell = this.grid.getCell(e.cellIndex); return true; // Boolean } }); // Produces html for grid header content. Owned by grid and used internally // for rendering data. Override to implement custom rendering. dg._HeaderBuilder = dojo.extend(function(view){ this.moveable = null; dg._Builder.call(this, view); },dg._Builder.prototype,{ _skipBogusClicks: false, overResizeWidth: 4, minColWidth: 1, update: function(){ if(this.tableMap){ this.tableMap.mapRows(this.view.structure.cells); }else{ this.tableMap = new dg._TableMap(this.view.structure.cells); } }, generateHtml: function(inGetValue, inValue){ var html = this.getTableArray(), cells = this.view.structure.cells; dojox.grid.util.fire(this.view, "onBeforeRow", [-1, cells]); for(var j=0, row; (row=cells[j]); j++){ if(row.hidden){ continue; } html.push(!row.invisible ? '' : ''); for(var i=0, cell, markup; (cell=row[i]); i++){ cell.customClasses = []; cell.customStyles = []; if(this.view.simpleStructure){ if(cell.headerClasses){ if(cell.headerClasses.indexOf('dojoDndItem') == -1){ cell.headerClasses += ' dojoDndItem'; } }else{ cell.headerClasses = 'dojoDndItem'; } if(cell.attrs){ if(cell.attrs.indexOf("dndType='gridColumn_") == -1){ cell.attrs += " dndType='gridColumn_" + this.grid.id + "'"; } }else{ cell.attrs = "dndType='gridColumn_" + this.grid.id + "'"; } } markup = this.generateCellMarkup(cell, cell.headerStyles, cell.headerClasses, true); // content markup[5] = (inValue != undefined ? inValue : inGetValue(cell)); // styles markup[3] = cell.customStyles.join(';'); // classes markup[1] = cell.customClasses.join(' '); //(cell.customClasses ? ' ' + cell.customClasses : ''); html.push(markup.join('')); } html.push(''); } html.push(''); return html.join(''); }, // event helpers getCellX: function(e){ var x = e.layerX; if(dojo.isMoz){ var n = ascendDom(e.target, makeNotTagName("th")); x -= (n && n.offsetLeft) || 0; var t = e.sourceView.getScrollbarWidth(); if(!dojo._isBodyLtr() && e.sourceView.headerNode.scrollLeft < t) x -= t; //x -= getProp(ascendDom(e.target, mkNotTagName("td")), "offsetLeft") || 0; } var n = ascendDom(e.target, function(){ if(!n || n == e.cellNode){ return false; } // Mozilla 1.8 (FF 1.5) has a bug that makes offsetLeft = -parent border width // when parent has border, overflow: hidden, and is positioned // handle this problem here ... not a general solution! x += (n.offsetLeft < 0 ? 0 : n.offsetLeft); return true; }); return x; }, // event decoration decorateEvent: function(e){ this.baseDecorateEvent(e); e.rowIndex = -1; e.cellX = this.getCellX(e); return true; }, // event handlers // resizing prepareResize: function(e, mod){ do{ var i = getTdIndex(e.cellNode); e.cellNode = (i ? e.cellNode.parentNode.cells[i+mod] : null); e.cellIndex = (e.cellNode ? this.getCellNodeIndex(e.cellNode) : -1); }while(e.cellNode && e.cellNode.style.display == "none"); return Boolean(e.cellNode); }, canResize: function(e){ if(!e.cellNode || e.cellNode.colSpan > 1){ return false; } var cell = this.grid.getCell(e.cellIndex); return !cell.noresize && cell.canResize(); }, overLeftResizeArea: function(e){ //Bugfix for crazy IE problem (#8807). IE returns position information for the icon and text arrow divs //as if they were still on the left instead of returning the position they were 'float: right' to. //So, the resize check ends up checking the wrong adjacent cell. This checks to see if the hover was over //the image or text nodes, then just ignored them/treat them not in scale range. if(dojo.isIE){ var tN = e.target; if(dojo.hasClass(tN, "dojoxGridArrowButtonNode") || dojo.hasClass(tN, "dojoxGridArrowButtonChar")){ return false; } } if(dojo._isBodyLtr()){ return (e.cellIndex>0) && (e.cellX < this.overResizeWidth) && this.prepareResize(e, -1); } var t = e.cellNode && (e.cellX < this.overResizeWidth); return t; }, overRightResizeArea: function(e){ //Bugfix for crazy IE problem (#8807). IE returns position information for the icon and text arrow divs //as if they were still on the left instead of returning the position they were 'float: right' to. //So, the resize check ends up checking the wrong adjacent cell. This checks to see if the hover was over //the image or text nodes, then just ignored them/treat them not in scale range. if(dojo.isIE){ var tN = e.target; if(dojo.hasClass(tN, "dojoxGridArrowButtonNode") || dojo.hasClass(tN, "dojoxGridArrowButtonChar")){ return false; } } if(dojo._isBodyLtr()){ return e.cellNode && (e.cellX >= e.cellNode.offsetWidth - this.overResizeWidth); } return (e.cellIndex>0) && (e.cellX >= e.cellNode.offsetWidth - this.overResizeWidth) && this.prepareResize(e, -1);";s:7:"returns";s:20:"Array|String|Boolean";s:7:"summary";s:0:"";}s:37:"dojox.grid._HeaderBuilder.domousemove";a:6:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:13846:"dojo.provide("dojox.grid._Builder"); dojo.require("dojox.grid.util"); dojo.require("dojo.dnd.Moveable"); (function(){ var dg = dojox.grid; var getTdIndex = function(td){ return td.cellIndex >=0 ? td.cellIndex : dojo.indexOf(td.parentNode.cells, td); }; var getTrIndex = function(tr){ return tr.rowIndex >=0 ? tr.rowIndex : dojo.indexOf(tr.parentNode.childNodes, tr); }; var getTr = function(rowOwner, index){ return rowOwner && ((rowOwner.rows||0)[index] || rowOwner.childNodes[index]); }; var findTable = function(node){ for(var n=node; n && n.tagName!='TABLE'; n=n.parentNode); return n; }; var ascendDom = function(inNode, inWhile){ for(var n=inNode; n && inWhile(n); n=n.parentNode); return n; }; var makeNotTagName = function(inTagName){ var name = inTagName.toUpperCase(); return function(node){ return node.tagName != name; }; }; var rowIndexTag = dojox.grid.util.rowIndexTag; var gridViewTag = dojox.grid.util.gridViewTag; // base class for generating markup for the views dg._Builder = dojo.extend(function(view){ if(view){ this.view = view; this.grid = view.grid; } },{ view: null, // boilerplate HTML _table: ''); return html; }, // generate starting tags for a cell generateCellMarkup: function(inCell, inMoreStyles, inMoreClasses, isHeader){ var result = [], html; var waiPrefix = dojo.isFF<3 ? "wairole:" : ""; if(isHeader){ var sortInfo = inCell.index != inCell.grid.getSortIndex() ? "" : inCell.grid.sortInfo > 0 ? 'aria-sort="ascending"' : 'aria-sort="descending"'; html = ['':''); return result; // Array }, // cell finding isCellNode: function(inNode){ return Boolean(inNode && inNode!=dojo.doc && dojo.attr(inNode, "idx")); }, getCellNodeIndex: function(inCellNode){ return inCellNode ? Number(dojo.attr(inCellNode, "idx")) : -1; }, getCellNode: function(inRowNode, inCellIndex){ for(var i=0, row; row=getTr(inRowNode.firstChild, i); i++){ for(var j=0, cell; cell=row.cells[j]; j++){ if(this.getCellNodeIndex(cell) == inCellIndex){ return cell; } } } }, findCellTarget: function(inSourceNode, inTopNode){ var n = inSourceNode; while(n && (!this.isCellNode(n) || (n.offsetParent && gridViewTag in n.offsetParent.parentNode && n.offsetParent.parentNode[gridViewTag] != this.view.id)) && (n!=inTopNode)){ n = n.parentNode; } return n!=inTopNode ? n : null }, // event decoration baseDecorateEvent: function(e){ e.dispatch = 'do' + e.type; e.grid = this.grid; e.sourceView = this.view; e.cellNode = this.findCellTarget(e.target, e.rowNode); e.cellIndex = this.getCellNodeIndex(e.cellNode); e.cell = (e.cellIndex >= 0 ? this.grid.getCell(e.cellIndex) : null); }, // event dispatch findTarget: function(inSource, inTag){ var n = inSource; while(n && (n!=this.domNode) && (!(inTag in n) || (gridViewTag in n && n[gridViewTag] != this.view.id))){ n = n.parentNode; } return (n != this.domNode) ? n : null; }, findRowTarget: function(inSource){ return this.findTarget(inSource, rowIndexTag); }, isIntraNodeEvent: function(e){ try{ return (e.cellNode && e.relatedTarget && dojo.isDescendant(e.relatedTarget, e.cellNode)); }catch(x){ // e.relatedTarget has permission problem in FF if it's an input: https://bugzilla.mozilla.org/show_bug.cgi?id=208427 return false; } }, isIntraRowEvent: function(e){ try{ var row = e.relatedTarget && this.findRowTarget(e.relatedTarget); return !row && (e.rowIndex==-1) || row && (e.rowIndex==row.gridRowIndex); }catch(x){ // e.relatedTarget on INPUT has permission problem in FF: https://bugzilla.mozilla.org/show_bug.cgi?id=208427 return false; } }, dispatchEvent: function(e){ if(e.dispatch in this){ return this[e.dispatch](e); } }, // dispatched event handlers domouseover: function(e){ if(e.cellNode && (e.cellNode!=this.lastOverCellNode)){ this.lastOverCellNode = e.cellNode; this.grid.onMouseOver(e); } this.grid.onMouseOverRow(e); }, domouseout: function(e){ if(e.cellNode && (e.cellNode==this.lastOverCellNode) && !this.isIntraNodeEvent(e, this.lastOverCellNode)){ this.lastOverCellNode = null; this.grid.onMouseOut(e); if(!this.isIntraRowEvent(e)){ this.grid.onMouseOutRow(e); } } }, domousedown: function(e){ if (e.cellNode) this.grid.onMouseDown(e); this.grid.onMouseDownRow(e) } }); // Produces html for grid data content. Owned by grid and used internally // for rendering data. Override to implement custom rendering. dg._ContentBuilder = dojo.extend(function(view){ dg._Builder.call(this, view); },dg._Builder.prototype,{ update: function(){ this.prepareHtml(); }, // cache html for rendering data rows prepareHtml: function(){ var defaultGet=this.grid.get, cells=this.view.structure.cells; for(var j=0, row; (row=cells[j]); j++){ for(var i=0, cell; (cell=row[i]); i++){ cell.get = cell.get || (cell.value == undefined) && defaultGet; cell.markup = this.generateCellMarkup(cell, cell.cellStyles, cell.cellClasses, false); } } }, // time critical: generate html using cache and data source generateHtml: function(inDataIndex, inRowIndex){ var html = this.getTableArray(), v = this.view, cells = v.structure.cells, item = this.grid.getItem(inRowIndex); dojox.grid.util.fire(this.view, "onBeforeRow", [inRowIndex, cells]); for(var j=0, row; (row=cells[j]); j++){ if(row.hidden || row.header){ continue; } html.push(!row.invisible ? '' : ''); for(var i=0, cell, m, cc, cs; (cell=row[i]); i++){ m = cell.markup, cc = cell.customClasses = [], cs = cell.customStyles = []; // content (format can fill in cc and cs as side-effects) m[5] = cell.format(inRowIndex, item); // classes m[1] = cc.join(' '); // styles m[3] = cs.join(';'); // in-place concat html.push.apply(html, m); } html.push(''); } html.push('
'); // result[4] => td postfix result.push(html.join('')); // SLOT: result[5] => content result.push(''); // result[6] => td closes result.push(isHeader?'
'); return html.join(''); // String }, decorateEvent: function(e){ e.rowNode = this.findRowTarget(e.target); if(!e.rowNode){return false}; e.rowIndex = e.rowNode[rowIndexTag]; this.baseDecorateEvent(e); e.cell = this.grid.getCell(e.cellIndex); return true; // Boolean } }); // Produces html for grid header content. Owned by grid and used internally // for rendering data. Override to implement custom rendering. dg._HeaderBuilder = dojo.extend(function(view){ this.moveable = null; dg._Builder.call(this, view); },dg._Builder.prototype,{ _skipBogusClicks: false, overResizeWidth: 4, minColWidth: 1, update: function(){ if(this.tableMap){ this.tableMap.mapRows(this.view.structure.cells); }else{ this.tableMap = new dg._TableMap(this.view.structure.cells); } }, generateHtml: function(inGetValue, inValue){ var html = this.getTableArray(), cells = this.view.structure.cells; dojox.grid.util.fire(this.view, "onBeforeRow", [-1, cells]); for(var j=0, row; (row=cells[j]); j++){ if(row.hidden){ continue; } html.push(!row.invisible ? '' : ''); for(var i=0, cell, markup; (cell=row[i]); i++){ cell.customClasses = []; cell.customStyles = []; if(this.view.simpleStructure){ if(cell.headerClasses){ if(cell.headerClasses.indexOf('dojoDndItem') == -1){ cell.headerClasses += ' dojoDndItem'; } }else{ cell.headerClasses = 'dojoDndItem'; } if(cell.attrs){ if(cell.attrs.indexOf("dndType='gridColumn_") == -1){ cell.attrs += " dndType='gridColumn_" + this.grid.id + "'"; } }else{ cell.attrs = "dndType='gridColumn_" + this.grid.id + "'"; } } markup = this.generateCellMarkup(cell, cell.headerStyles, cell.headerClasses, true); // content markup[5] = (inValue != undefined ? inValue : inGetValue(cell)); // styles markup[3] = cell.customStyles.join(';'); // classes markup[1] = cell.customClasses.join(' '); //(cell.customClasses ? ' ' + cell.customClasses : ''); html.push(markup.join('')); } html.push(''); } html.push(''); return html.join(''); }, // event helpers getCellX: function(e){ var x = e.layerX; if(dojo.isMoz){ var n = ascendDom(e.target, makeNotTagName("th")); x -= (n && n.offsetLeft) || 0; var t = e.sourceView.getScrollbarWidth(); if(!dojo._isBodyLtr() && e.sourceView.headerNode.scrollLeft < t) x -= t; //x -= getProp(ascendDom(e.target, mkNotTagName("td")), "offsetLeft") || 0; } var n = ascendDom(e.target, function(){ if(!n || n == e.cellNode){ return false; } // Mozilla 1.8 (FF 1.5) has a bug that makes offsetLeft = -parent border width // when parent has border, overflow: hidden, and is positioned // handle this problem here ... not a general solution! x += (n.offsetLeft < 0 ? 0 : n.offsetLeft); return true; }); return x; }, // event decoration decorateEvent: function(e){ this.baseDecorateEvent(e); e.rowIndex = -1; e.cellX = this.getCellX(e); return true; }, // event handlers // resizing prepareResize: function(e, mod){ do{ var i = getTdIndex(e.cellNode); e.cellNode = (i ? e.cellNode.parentNode.cells[i+mod] : null); e.cellIndex = (e.cellNode ? this.getCellNodeIndex(e.cellNode) : -1); }while(e.cellNode && e.cellNode.style.display == "none"); return Boolean(e.cellNode); }, canResize: function(e){ if(!e.cellNode || e.cellNode.colSpan > 1){ return false; } var cell = this.grid.getCell(e.cellIndex); return !cell.noresize && cell.canResize(); }, overLeftResizeArea: function(e){ //Bugfix for crazy IE problem (#8807). IE returns position information for the icon and text arrow divs //as if they were still on the left instead of returning the position they were 'float: right' to. //So, the resize check ends up checking the wrong adjacent cell. This checks to see if the hover was over //the image or text nodes, then just ignored them/treat them not in scale range. if(dojo.isIE){ var tN = e.target; if(dojo.hasClass(tN, "dojoxGridArrowButtonNode") || dojo.hasClass(tN, "dojoxGridArrowButtonChar")){ return false; } } if(dojo._isBodyLtr()){ return (e.cellIndex>0) && (e.cellX < this.overResizeWidth) && this.prepareResize(e, -1); } var t = e.cellNode && (e.cellX < this.overResizeWidth); return t; }, overRightResizeArea: function(e){ //Bugfix for crazy IE problem (#8807). IE returns position information for the icon and text arrow divs //as if they were still on the left instead of returning the position they were 'float: right' to. //So, the resize check ends up checking the wrong adjacent cell. This checks to see if the hover was over //the image or text nodes, then just ignored them/treat them not in scale range. if(dojo.isIE){ var tN = e.target; if(dojo.hasClass(tN, "dojoxGridArrowButtonNode") || dojo.hasClass(tN, "dojoxGridArrowButtonChar")){ return false; } } if(dojo._isBodyLtr()){ return e.cellNode && (e.cellX >= e.cellNode.offsetWidth - this.overResizeWidth); } return (e.cellIndex>0) && (e.cellX >= e.cellNode.offsetWidth - this.overResizeWidth) && this.prepareResize(e, -1); }, domousemove: function(e){ //console.log(e.cellIndex, e.cellX, e.cellNode.offsetWidth); if(!this.moveable){ var c = (this.overRightResizeArea(e) ? 'e-resize' : (this.overLeftResizeArea(e) ? 'w-resize' : '')); if(c && !this.canResize(e)){ c = 'not-allowed'; } if(dojo.isIE){ var t = e.sourceView.headerNode.scrollLeft; e.sourceView.headerNode.style.cursor = c || ''; //'default'; e.sourceView.headerNode.scrollLeft = t; }else{ e.sourceView.headerNode.style.cursor = c || ''; //'default'; } if(c){ dojo.stopEvent(e); } }";s:7:"returns";s:20:"Array|String|Boolean";s:7:"summary";s:0:"";}s:37:"dojox.grid._HeaderBuilder.domousedown";a:5:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:283:" if(!this.moveable){ if((this.overRightResizeArea(e) || this.overLeftResizeArea(e)) && this.canResize(e)){ this.beginColumnResize(e); }else{ this.grid.onMouseDown(e); this.grid.onMouseOverRow(e); } //else{ // this.beginMoveColumn(e); //} }";s:7:"summary";s:0:"";}s:33:"dojox.grid._HeaderBuilder.doclick";a:5:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:74:" if(this._skipBogusClicks){ dojo.stopEvent(e); return true; }";s:7:"summary";s:0:"";}s:43:"dojox.grid._HeaderBuilder.beginColumnResize";a:5:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:1641:" this.moverDiv = document.createElement("div"); dojo.style(this.moverDiv,{position: "absolute", left:0}); // to make DnD work with dir=rtl dojo.body().appendChild(this.moverDiv); var m = this.moveable = new dojo.dnd.Moveable(this.moverDiv); var spanners = [], nodes = this.tableMap.findOverlappingNodes(e.cellNode); for(var i=0, cell; (cell=nodes[i]); i++){ spanners.push({ node: cell, index: this.getCellNodeIndex(cell), width: cell.offsetWidth }); //console.log("spanner: " + this.getCellNodeIndex(cell)); } var view = e.sourceView; var adj = dojo._isBodyLtr() ? 1 : -1; var views = e.grid.views.views; var followers = []; for(var i=view.idx+adj, cView; (cView=views[i]); i=i+adj){ followers.push({ node: cView.headerNode, left: window.parseInt(cView.headerNode.style.left) }); } var table = view.headerContentNode.firstChild; var drag = { scrollLeft: e.sourceView.headerNode.scrollLeft, view: view, node: e.cellNode, index: e.cellIndex, w: dojo.contentBox(e.cellNode).w, vw: dojo.contentBox(view.headerNode).w, table: table, tw: dojo.contentBox(table).w, spanners: spanners, followers: followers }; m.onMove = dojo.hitch(this, "doResizeColumn", drag); dojo.connect(m, "onMoveStop", dojo.hitch(this, function(){ this.endResizeColumn(drag); if(drag.node.releaseCapture){ drag.node.releaseCapture(); } this.moveable.destroy(); delete this.moveable; this.moveable = null; })); view.convertColPctToFixed(); if(e.cellNode.setCapture){ e.cellNode.setCapture(); } m.onMouseDown(e);";s:7:"summary";s:0:"";}s:34:"dojox.grid._HeaderBuilder.moverDiv";a:2:{s:8:"instance";s:25:"dojox.grid._HeaderBuilder";s:7:"summary";s:0:"";}s:40:"dojox.grid._HeaderBuilder.doResizeColumn";a:5:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:6:"inDrag";a:1:{s:4:"type";s:0:"";}s:5:"mover";a:1:{s:4:"type";s:0:"";}s:7:"leftTop";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:963:" var isLtr = dojo._isBodyLtr(); var deltaX = isLtr ? leftTop.l : -leftTop.l; var w = inDrag.w + deltaX; var vw = inDrag.vw + deltaX; var tw = inDrag.tw + deltaX; if(w >= this.minColWidth){ for(var i=0, s, sw; (s=inDrag.spanners[i]); i++){ sw = s.width + deltaX; s.node.style.width = sw + 'px'; inDrag.view.setColWidth(s.index, sw); //console.log('setColWidth', '#' + s.index, sw + 'px'); } for(var i=0, f, fl; (f=inDrag.followers[i]); i++){ fl = f.left + deltaX; f.node.style.left = fl + 'px'; } inDrag.node.style.width = w + 'px'; inDrag.view.setColWidth(inDrag.index, w); inDrag.view.headerNode.style.width = vw + 'px'; inDrag.view.setColumnsWidth(tw); if(!isLtr){ inDrag.view.headerNode.scrollLeft = inDrag.scrollLeft + deltaX; } } if(inDrag.view.flexCells && !inDrag.view.testFlexCells()){ var t = findTable(inDrag.node); t && (t.style.width = ''); }";s:7:"summary";s:0:"";}s:41:"dojox.grid._HeaderBuilder.endResizeColumn";a:5:{s:9:"prototype";s:25:"dojox.grid._HeaderBuilder";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"inDrag";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:280:" dojo.destroy(this.moverDiv); delete this.moverDiv; this._skipBogusClicks = true; var conn = dojo.connect(inDrag.view, "update", this, function(){ dojo.disconnect(conn); this._skipBogusClicks = false; }); setTimeout(dojo.hitch(inDrag.view, "update"), 50);";s:7:"summary";s:0:"";}s:24:"dojox.grid._TableMap.map";a:3:{s:9:"prototype";s:20:"dojox.grid._TableMap";s:8:"instance";s:20:"dojox.grid._TableMap";s:7:"summary";s:0:"";}s:28:"dojox.grid._TableMap.mapRows";a:6:{s:9:"prototype";s:20:"dojox.grid._TableMap";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"inRows";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:18296:"dojo.provide("dojox.grid._Builder"); dojo.require("dojox.grid.util"); dojo.require("dojo.dnd.Moveable"); (function(){ var dg = dojox.grid; var getTdIndex = function(td){ return td.cellIndex >=0 ? td.cellIndex : dojo.indexOf(td.parentNode.cells, td); }; var getTrIndex = function(tr){ return tr.rowIndex >=0 ? tr.rowIndex : dojo.indexOf(tr.parentNode.childNodes, tr); }; var getTr = function(rowOwner, index){ return rowOwner && ((rowOwner.rows||0)[index] || rowOwner.childNodes[index]); }; var findTable = function(node){ for(var n=node; n && n.tagName!='TABLE'; n=n.parentNode); return n; }; var ascendDom = function(inNode, inWhile){ for(var n=inNode; n && inWhile(n); n=n.parentNode); return n; }; var makeNotTagName = function(inTagName){ var name = inTagName.toUpperCase(); return function(node){ return node.tagName != name; }; }; var rowIndexTag = dojox.grid.util.rowIndexTag; var gridViewTag = dojox.grid.util.gridViewTag; // base class for generating markup for the views dg._Builder = dojo.extend(function(view){ if(view){ this.view = view; this.grid = view.grid; } },{ view: null, // boilerplate HTML _table: ''); return html; }, // generate starting tags for a cell generateCellMarkup: function(inCell, inMoreStyles, inMoreClasses, isHeader){ var result = [], html; var waiPrefix = dojo.isFF<3 ? "wairole:" : ""; if(isHeader){ var sortInfo = inCell.index != inCell.grid.getSortIndex() ? "" : inCell.grid.sortInfo > 0 ? 'aria-sort="ascending"' : 'aria-sort="descending"'; html = ['':''); return result; // Array }, // cell finding isCellNode: function(inNode){ return Boolean(inNode && inNode!=dojo.doc && dojo.attr(inNode, "idx")); }, getCellNodeIndex: function(inCellNode){ return inCellNode ? Number(dojo.attr(inCellNode, "idx")) : -1; }, getCellNode: function(inRowNode, inCellIndex){ for(var i=0, row; row=getTr(inRowNode.firstChild, i); i++){ for(var j=0, cell; cell=row.cells[j]; j++){ if(this.getCellNodeIndex(cell) == inCellIndex){ return cell; } } } }, findCellTarget: function(inSourceNode, inTopNode){ var n = inSourceNode; while(n && (!this.isCellNode(n) || (n.offsetParent && gridViewTag in n.offsetParent.parentNode && n.offsetParent.parentNode[gridViewTag] != this.view.id)) && (n!=inTopNode)){ n = n.parentNode; } return n!=inTopNode ? n : null }, // event decoration baseDecorateEvent: function(e){ e.dispatch = 'do' + e.type; e.grid = this.grid; e.sourceView = this.view; e.cellNode = this.findCellTarget(e.target, e.rowNode); e.cellIndex = this.getCellNodeIndex(e.cellNode); e.cell = (e.cellIndex >= 0 ? this.grid.getCell(e.cellIndex) : null); }, // event dispatch findTarget: function(inSource, inTag){ var n = inSource; while(n && (n!=this.domNode) && (!(inTag in n) || (gridViewTag in n && n[gridViewTag] != this.view.id))){ n = n.parentNode; } return (n != this.domNode) ? n : null; }, findRowTarget: function(inSource){ return this.findTarget(inSource, rowIndexTag); }, isIntraNodeEvent: function(e){ try{ return (e.cellNode && e.relatedTarget && dojo.isDescendant(e.relatedTarget, e.cellNode)); }catch(x){ // e.relatedTarget has permission problem in FF if it's an input: https://bugzilla.mozilla.org/show_bug.cgi?id=208427 return false; } }, isIntraRowEvent: function(e){ try{ var row = e.relatedTarget && this.findRowTarget(e.relatedTarget); return !row && (e.rowIndex==-1) || row && (e.rowIndex==row.gridRowIndex); }catch(x){ // e.relatedTarget on INPUT has permission problem in FF: https://bugzilla.mozilla.org/show_bug.cgi?id=208427 return false; } }, dispatchEvent: function(e){ if(e.dispatch in this){ return this[e.dispatch](e); } }, // dispatched event handlers domouseover: function(e){ if(e.cellNode && (e.cellNode!=this.lastOverCellNode)){ this.lastOverCellNode = e.cellNode; this.grid.onMouseOver(e); } this.grid.onMouseOverRow(e); }, domouseout: function(e){ if(e.cellNode && (e.cellNode==this.lastOverCellNode) && !this.isIntraNodeEvent(e, this.lastOverCellNode)){ this.lastOverCellNode = null; this.grid.onMouseOut(e); if(!this.isIntraRowEvent(e)){ this.grid.onMouseOutRow(e); } } }, domousedown: function(e){ if (e.cellNode) this.grid.onMouseDown(e); this.grid.onMouseDownRow(e) } }); // Produces html for grid data content. Owned by grid and used internally // for rendering data. Override to implement custom rendering. dg._ContentBuilder = dojo.extend(function(view){ dg._Builder.call(this, view); },dg._Builder.prototype,{ update: function(){ this.prepareHtml(); }, // cache html for rendering data rows prepareHtml: function(){ var defaultGet=this.grid.get, cells=this.view.structure.cells; for(var j=0, row; (row=cells[j]); j++){ for(var i=0, cell; (cell=row[i]); i++){ cell.get = cell.get || (cell.value == undefined) && defaultGet; cell.markup = this.generateCellMarkup(cell, cell.cellStyles, cell.cellClasses, false); } } }, // time critical: generate html using cache and data source generateHtml: function(inDataIndex, inRowIndex){ var html = this.getTableArray(), v = this.view, cells = v.structure.cells, item = this.grid.getItem(inRowIndex); dojox.grid.util.fire(this.view, "onBeforeRow", [inRowIndex, cells]); for(var j=0, row; (row=cells[j]); j++){ if(row.hidden || row.header){ continue; } html.push(!row.invisible ? '' : ''); for(var i=0, cell, m, cc, cs; (cell=row[i]); i++){ m = cell.markup, cc = cell.customClasses = [], cs = cell.customStyles = []; // content (format can fill in cc and cs as side-effects) m[5] = cell.format(inRowIndex, item); // classes m[1] = cc.join(' '); // styles m[3] = cs.join(';'); // in-place concat html.push.apply(html, m); } html.push(''); } html.push('
'); // result[4] => td postfix result.push(html.join('')); // SLOT: result[5] => content result.push(''); // result[6] => td closes result.push(isHeader?'
'); return html.join(''); // String }, decorateEvent: function(e){ e.rowNode = this.findRowTarget(e.target); if(!e.rowNode){return false}; e.rowIndex = e.rowNode[rowIndexTag]; this.baseDecorateEvent(e); e.cell = this.grid.getCell(e.cellIndex); return true; // Boolean } }); // Produces html for grid header content. Owned by grid and used internally // for rendering data. Override to implement custom rendering. dg._HeaderBuilder = dojo.extend(function(view){ this.moveable = null; dg._Builder.call(this, view); },dg._Builder.prototype,{ _skipBogusClicks: false, overResizeWidth: 4, minColWidth: 1, update: function(){ if(this.tableMap){ this.tableMap.mapRows(this.view.structure.cells); }else{ this.tableMap = new dg._TableMap(this.view.structure.cells); } }, generateHtml: function(inGetValue, inValue){ var html = this.getTableArray(), cells = this.view.structure.cells; dojox.grid.util.fire(this.view, "onBeforeRow", [-1, cells]); for(var j=0, row; (row=cells[j]); j++){ if(row.hidden){ continue; } html.push(!row.invisible ? '' : ''); for(var i=0, cell, markup; (cell=row[i]); i++){ cell.customClasses = []; cell.customStyles = []; if(this.view.simpleStructure){ if(cell.headerClasses){ if(cell.headerClasses.indexOf('dojoDndItem') == -1){ cell.headerClasses += ' dojoDndItem'; } }else{ cell.headerClasses = 'dojoDndItem'; } if(cell.attrs){ if(cell.attrs.indexOf("dndType='gridColumn_") == -1){ cell.attrs += " dndType='gridColumn_" + this.grid.id + "'"; } }else{ cell.attrs = "dndType='gridColumn_" + this.grid.id + "'"; } } markup = this.generateCellMarkup(cell, cell.headerStyles, cell.headerClasses, true); // content markup[5] = (inValue != undefined ? inValue : inGetValue(cell)); // styles markup[3] = cell.customStyles.join(';'); // classes markup[1] = cell.customClasses.join(' '); //(cell.customClasses ? ' ' + cell.customClasses : ''); html.push(markup.join('')); } html.push(''); } html.push(''); return html.join(''); }, // event helpers getCellX: function(e){ var x = e.layerX; if(dojo.isMoz){ var n = ascendDom(e.target, makeNotTagName("th")); x -= (n && n.offsetLeft) || 0; var t = e.sourceView.getScrollbarWidth(); if(!dojo._isBodyLtr() && e.sourceView.headerNode.scrollLeft < t) x -= t; //x -= getProp(ascendDom(e.target, mkNotTagName("td")), "offsetLeft") || 0; } var n = ascendDom(e.target, function(){ if(!n || n == e.cellNode){ return false; } // Mozilla 1.8 (FF 1.5) has a bug that makes offsetLeft = -parent border width // when parent has border, overflow: hidden, and is positioned // handle this problem here ... not a general solution! x += (n.offsetLeft < 0 ? 0 : n.offsetLeft); return true; }); return x; }, // event decoration decorateEvent: function(e){ this.baseDecorateEvent(e); e.rowIndex = -1; e.cellX = this.getCellX(e); return true; }, // event handlers // resizing prepareResize: function(e, mod){ do{ var i = getTdIndex(e.cellNode); e.cellNode = (i ? e.cellNode.parentNode.cells[i+mod] : null); e.cellIndex = (e.cellNode ? this.getCellNodeIndex(e.cellNode) : -1); }while(e.cellNode && e.cellNode.style.display == "none"); return Boolean(e.cellNode); }, canResize: function(e){ if(!e.cellNode || e.cellNode.colSpan > 1){ return false; } var cell = this.grid.getCell(e.cellIndex); return !cell.noresize && cell.canResize(); }, overLeftResizeArea: function(e){ //Bugfix for crazy IE problem (#8807). IE returns position information for the icon and text arrow divs //as if they were still on the left instead of returning the position they were 'float: right' to. //So, the resize check ends up checking the wrong adjacent cell. This checks to see if the hover was over //the image or text nodes, then just ignored them/treat them not in scale range. if(dojo.isIE){ var tN = e.target; if(dojo.hasClass(tN, "dojoxGridArrowButtonNode") || dojo.hasClass(tN, "dojoxGridArrowButtonChar")){ return false; } } if(dojo._isBodyLtr()){ return (e.cellIndex>0) && (e.cellX < this.overResizeWidth) && this.prepareResize(e, -1); } var t = e.cellNode && (e.cellX < this.overResizeWidth); return t; }, overRightResizeArea: function(e){ //Bugfix for crazy IE problem (#8807). IE returns position information for the icon and text arrow divs //as if they were still on the left instead of returning the position they were 'float: right' to. //So, the resize check ends up checking the wrong adjacent cell. This checks to see if the hover was over //the image or text nodes, then just ignored them/treat them not in scale range. if(dojo.isIE){ var tN = e.target; if(dojo.hasClass(tN, "dojoxGridArrowButtonNode") || dojo.hasClass(tN, "dojoxGridArrowButtonChar")){ return false; } } if(dojo._isBodyLtr()){ return e.cellNode && (e.cellX >= e.cellNode.offsetWidth - this.overResizeWidth); } return (e.cellIndex>0) && (e.cellX >= e.cellNode.offsetWidth - this.overResizeWidth) && this.prepareResize(e, -1); }, domousemove: function(e){ //console.log(e.cellIndex, e.cellX, e.cellNode.offsetWidth); if(!this.moveable){ var c = (this.overRightResizeArea(e) ? 'e-resize' : (this.overLeftResizeArea(e) ? 'w-resize' : '')); if(c && !this.canResize(e)){ c = 'not-allowed'; } if(dojo.isIE){ var t = e.sourceView.headerNode.scrollLeft; e.sourceView.headerNode.style.cursor = c || ''; //'default'; e.sourceView.headerNode.scrollLeft = t; }else{ e.sourceView.headerNode.style.cursor = c || ''; //'default'; } if(c){ dojo.stopEvent(e); } } }, domousedown: function(e){ if(!this.moveable){ if((this.overRightResizeArea(e) || this.overLeftResizeArea(e)) && this.canResize(e)){ this.beginColumnResize(e); }else{ this.grid.onMouseDown(e); this.grid.onMouseOverRow(e); } //else{ // this.beginMoveColumn(e); //} } }, doclick: function(e) { if(this._skipBogusClicks){ dojo.stopEvent(e); return true; } }, // column resizing beginColumnResize: function(e){ this.moverDiv = document.createElement("div"); dojo.style(this.moverDiv,{position: "absolute", left:0}); // to make DnD work with dir=rtl dojo.body().appendChild(this.moverDiv); var m = this.moveable = new dojo.dnd.Moveable(this.moverDiv); var spanners = [], nodes = this.tableMap.findOverlappingNodes(e.cellNode); for(var i=0, cell; (cell=nodes[i]); i++){ spanners.push({ node: cell, index: this.getCellNodeIndex(cell), width: cell.offsetWidth }); //console.log("spanner: " + this.getCellNodeIndex(cell)); } var view = e.sourceView; var adj = dojo._isBodyLtr() ? 1 : -1; var views = e.grid.views.views; var followers = []; for(var i=view.idx+adj, cView; (cView=views[i]); i=i+adj){ followers.push({ node: cView.headerNode, left: window.parseInt(cView.headerNode.style.left) }); } var table = view.headerContentNode.firstChild; var drag = { scrollLeft: e.sourceView.headerNode.scrollLeft, view: view, node: e.cellNode, index: e.cellIndex, w: dojo.contentBox(e.cellNode).w, vw: dojo.contentBox(view.headerNode).w, table: table, tw: dojo.contentBox(table).w, spanners: spanners, followers: followers }; m.onMove = dojo.hitch(this, "doResizeColumn", drag); dojo.connect(m, "onMoveStop", dojo.hitch(this, function(){ this.endResizeColumn(drag); if(drag.node.releaseCapture){ drag.node.releaseCapture(); } this.moveable.destroy(); delete this.moveable; this.moveable = null; })); view.convertColPctToFixed(); if(e.cellNode.setCapture){ e.cellNode.setCapture(); } m.onMouseDown(e); }, doResizeColumn: function(inDrag, mover, leftTop){ var isLtr = dojo._isBodyLtr(); var deltaX = isLtr ? leftTop.l : -leftTop.l; var w = inDrag.w + deltaX; var vw = inDrag.vw + deltaX; var tw = inDrag.tw + deltaX; if(w >= this.minColWidth){ for(var i=0, s, sw; (s=inDrag.spanners[i]); i++){ sw = s.width + deltaX; s.node.style.width = sw + 'px'; inDrag.view.setColWidth(s.index, sw); //console.log('setColWidth', '#' + s.index, sw + 'px'); } for(var i=0, f, fl; (f=inDrag.followers[i]); i++){ fl = f.left + deltaX; f.node.style.left = fl + 'px'; } inDrag.node.style.width = w + 'px'; inDrag.view.setColWidth(inDrag.index, w); inDrag.view.headerNode.style.width = vw + 'px'; inDrag.view.setColumnsWidth(tw); if(!isLtr){ inDrag.view.headerNode.scrollLeft = inDrag.scrollLeft + deltaX; } } if(inDrag.view.flexCells && !inDrag.view.testFlexCells()){ var t = findTable(inDrag.node); t && (t.style.width = ''); } }, endResizeColumn: function(inDrag){ dojo.destroy(this.moverDiv); delete this.moverDiv; this._skipBogusClicks = true; var conn = dojo.connect(inDrag.view, "update", this, function(){ dojo.disconnect(conn); this._skipBogusClicks = false; }); setTimeout(dojo.hitch(inDrag.view, "update"), 50); } }); // Maps an html table into a structure parsable for information about cell row and col spanning. // Used by HeaderBuilder. dg._TableMap = dojo.extend(function(rows){ this.mapRows(rows); },{ map: null, mapRows: function(inRows){ // summary: Map table topography //console.log('mapRows'); // # of rows var rowCount = inRows.length; if(!rowCount){ return; } // map which columns and rows fill which cells this.map = []; for(var j=0, row; (row=inRows[j]); j++){ this.map[j] = []; } for(var j=0, row; (row=inRows[j]); j++){ for(var i=0, x=0, cell, colSpan, rowSpan; (cell=row[i]); i++){ while (this.map[j][x]){x++}; this.map[j][x] = { c: i, r: j }; rowSpan = cell.rowSpan || 1; colSpan = cell.colSpan || 1; for(var y=0; y