| Page 1 of 1 | [ 1 post ] |
|
I have added the image into the column header and the tooltip shows up on hover of this image.
The problem is that when this column header is sorted the tooltip disappears. Code: YAHOO.util.Event.addListener(window, "load", function() { var tableAppt = function() { var myColumnDefs = [ {key:"state", label:"State", sortable:true, sortOptions:{defaultDir:YAHOO.widget.DataTable.CLASS_DESC},resizeable:true}, {key:"status", label:"<span class='iconInfo' id='triggerttStatus'>Status</span>", sortable:true, resizeable:true}, {key:"effectivefrom", label:"Effective Date", formatter:YAHOO.widget.DataTable.formatDate, sortable:true, resizeable:true}, {key:"lob", label:"Line of Business", sortable:true, resizeable:true} ]; var myDataSource = new YAHOO.util.DataSource(YAHOO.example.Data.appointments); myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; myDataSource.responseSchema = { fields: ["state","status","effectivefrom","lob"] }; var myDataTable = new YAHOO.widget.DataTable("tblAppt", myColumnDefs, myDataSource); myDataTable.set("MSG_SORTASC",""); myDataTable.set("MSG_SORTDESC",""); //Tooltip var ttBtn = new YAHOO.widget.Tooltip("ttBtn", { context:"triggerttStatus"}); ttBtn.setHeader(" "); ttBtn.setFooter(" "); ttBtn.setBody ("JIT: <span>Just In Time</span>"); //var showTimer,hideTimer; myDataTable.on('theadLabelMouseoverEvent', function (oArgs) { if (showTimer) { window.clearTimeout(showTimer); showTimer = 0; } showTimer = window.setTimeout(function() { ttBtn.show(); hideTimer = window.setTimeout(function() { ttBtn.hide(); },3000); },300); }); myDataTable.on('theadLabelMouseoutEvent', function (oArgs) { if (showTimer) { window.clearTimeout(showTimer); showTimer = 0; } if (hideTimer) { window.clearTimeout(hideTimer); hideTimer = 0; } ttBtn.hide(); }); //End tooltip return { oDS: myDataSource, oDT: myDataTable }; }(); }); |
| Page 1 of 1 | [ 1 post ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group