-
17 Sep 2010 6:17 AM #1
Prevent tooltip from showing
Prevent tooltip from showing
Hey,
I am stuck on this problem where I have a tooltip on specific cells in an EditorGridPanel. When my grid contains data, the tooltip is working fine. But it can happen that my grid doesn't contain data, in that case I show an emptyText. When I hover my mouse over the grid(with no data) I get the following error: this.config[col] is undefined.
The problem is that I show a tooltip based the dataIndex the column has on which my mouse is standing.Code:getDataIndex : function(col){ return this.config[col].dataIndex; <-- Error } //Error on line 45686 in ext-all-debug.js
My JS code for doing that is:
When my grid is empty I don't want to show a tooltip. How can I prevent this error from showing ?Code:beforeshow : function updateToolTip(tip){ var columnIndex = grid.getView().findCellIndex(tip.triggerElement); var rowIndex = grid.getView().findRowIndex(tip.triggerElement); var dataIndex = grid.getColumnModel().getDataIndex(columnIndex); // Switch based on dataIndex. switch (dataIndex){ case "organisatie": //Show tooltip break;
-
17 Sep 2010 6:26 AM #2
See if the triggerElement is an empty grid body
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
17 Sep 2010 6:28 AM #3
Or just check what you get back from findCellIndex and findRowIndex. They're probably -1!
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
17 Sep 2010 6:30 AM #4
I just checked for you.
Both return false if the element does NOT lead to a valid row index or column index.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
17 Sep 2010 6:38 AM #5
Got it working now, checking if the columnIndex and rowIndex weren't false did the trick,
Thx for the quick reply,
Similar Threads
-
interceptTitles failing to prevent default title from showing up
By wp.joju in forum Ext 3.x: Help & DiscussionReplies: 3Last Post: 28 Oct 2011, 5:20 AM -
Tooltip not showing on first hover
By Muhlegg in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 5 Jul 2010, 12:29 AM -
extjs tooltip to prevent default tooltip
By wp.joju in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 1 Jul 2010, 7:43 AM -
Prevent Grid header showing ellipsis in Safari
By FlyFoxUK in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 11 Jun 2010, 6:04 PM


Reply With Quote