Categories | Question details Back To List | ||||||||
Images alt text Hi, Is there anyway to crack the auto-alt function in certain cells? I'm trying to specify alt text to images in the grid cells, but it shows an empty infobox. Thanks in advanance! Answer posted on Nov 26, 2007 02:06 Latest build of dhtmlxgrid supports "title" attribute of "cell" tag, so it possible to define tooltip value directly from XML. Also it possible to redefine function, which generates tooltips based on cell value - please check attached sample If problem still occurs for you - please provide any kind of sample where problem can be reconstructed. ( you can contact us directly at support@dhtmlx.com ) Attachments (1)
Answer posted by Geza Szekeres on Nov 26, 2007 03:27 Thanks for your quick response! That's the function what I was looking for. I've modified it a bit.. imageAlt is loaded up by imgs onmouse events (with img.alt) Hope it also helps others. /*========= Tooltip modification start ==============*/ var imageAlt=""; dhtmlXGridCellObject.prototype.getTitle=function(){ var img=this.cell.getElementsByTagName('img'); var link=this.cell.getElementsByTagName('a'); if(img.length>0){ var tip=imageAlt; }else if(link.length>0){ var tip=link[0].innerHTML; }else{ var tip=this.cell.innerHTML; } if (tip) return tip; return ""; } /*========= Tooltip modification end ==============*/ |