dojo.provide("dojox.grid.compat._grid.lib"); // summary: grid utility library dojo.mixin(dojox.grid,{ na: '...', nop: function(){ // summary: a null function? }, getTdIndex: function(td){ return td.cellIndex >=0 ? td.cellIndex : dojo.indexOf(td.parentNode.cells, td); }, getTrIndex: function(tr){ return tr.rowIndex >=0 ? tr.rowIndex : dojo.indexOf(tr.parentNode.childNodes, tr); }, getTr: function(rowOwner, index){ return rowOwner && ((rowOwner.rows||0)[index] || rowOwner.childNodes[index]); }, getTd: function(rowOwner, rowIndex, cellIndex){ return (dojox.grid.getTr(inTable, rowIndex)||0)[cellIndex]; }, findTable: function(node){ for (var n=node; n && n.tagName!='TABLE'; n=n.parentNode); return n; }, ascendDom: function(inNode, inWhile){ for (var n=inNode; n && inWhile(n); n=n.parentNode); return n; }, makeNotTagName: function(inTagName){ var name = inTagName.toUpperCase(); return function(node){ return node.tagName != name; }; }, fire: function(ob, ev, args){ var fn = ob && ev && ob[ev]; return fn && (args ? fn.apply(ob, args) : ob[ev]()); }, // from lib.js setStyleText: function(inNode, inStyleText){ if(inNode.style.cssText == undefined){ inNode.setAttribute("style", inStyleText); }else{ inNode.style.cssText = inStyleText; } }, getStyleText: function(inNode, inStyleText){ return (inNode.style.cssText == undefined ? inNode.getAttribute("style") : inNode.style.cssText); }, setStyle: function(inElement, inStyle, inValue){ if(inElement && inElement.style[inStyle] != inValue){ inElement.style[inStyle] = inValue; } }, setStyleHeightPx: function(inElement, inHeight){ if(inHeight >= 0){ dojox.grid.setStyle(inElement, 'height', inHeight + 'px'); } }, mouseEvents: [ 'mouseover', 'mouseout', /*'mousemove',*/ 'mousedown', 'mouseup', 'click', 'dblclick', 'contextmenu' ], keyEvents: [ 'keyup', 'keydown', 'keypress' ], funnelEvents: function(inNode, inObject, inMethod, inEvents){ var evts = (inEvents ? inEvents : dojox.grid.mouseEvents.concat(dojox.grid.keyEvents)); for (var i=0, l=evts.length; i