Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9221 closed enhancement (fixed)

Setting id of domNode on tab control button

Reported by: Josh Trutwin Owned by: bill
Priority: high Milestone: 1.4
Component: Dijit Version: 1.3.0
Keywords: tab button tooltip domNode Cc:
Blocked By: Blocking:

Description

If you want to set a tooltip on a tab button, you cannot use the id of the content pane, but you can do this:

dijit.byId('tab').controlButton.domNode.id = 'foo';

tt = new dijit.Tooltip({ label: 'foo', connectId: ['foo'] });

Setting the .id property is needed as this node does not have an id otherwise.

Would it be possible to set the domNode's id (perhaps to its widgetId) so could at least do this to make a tooltip on a tab button:

tt = new dijit.Tooltip({ label: 'foo', connectId: [dijit.byId('tab').controlButton.domNode.id] });

Or maybe some easier, user-friendlier way?

tt = new dijit.Tooltip({ label: 'foo', connectId: [dijit.byId('tab').controlButtonId] });

Change History (4)

comment:1 Changed 10 years ago by bill

Milestone: tbd1.4
Owner: set to bill
Status: newassigned

This is covered is #7508 although you are asking for a poor man's solution. I don't see anything wrong w/checking in the poor man's solution too.

There's an annoying complication that since you can have multiple StackController's (TabController's base class) for a single StackContainer, it means that you can have multiple buttons connected to the same pane, and thus we can't label the buttons something like 'pane1_button' because it might not be unique.

However, I can add code so it ends up as myTabContainer_tablist_pane1 (corresponding to the pane called "pane1").

comment:2 in reply to:  1 Changed 10 years ago by Josh Trutwin

Replying to bill:

This is covered is #7508 although you are asking for a poor man's solution. I don't see anything wrong w/checking in the poor man's solution too.

There's an annoying complication that since you can have multiple StackController's (TabController's base class) for a single StackContainer, it means that you can have multiple buttons connected to the same pane, and thus we can't label the buttons something like 'pane1_button' because it might not be unique.

However, I can add code so it ends up as myTabContainer_tablist_pane1 (corresponding to the pane called "pane1").

That would be great - thanks. I guess I don't really care *what* the id is, so long as it has one. :)

Josh

comment:3 Changed 10 years ago by bill

Resolution: fixed
Status: assignedclosed

Oh, I fixed this already, guess it didn't get updated here. It's in [17512].

comment:4 Changed 10 years ago by bill

(In [18042]) Update test since tabs now have deterministic id's, fixing spurious test failure. Refs #9221.

Note: See TracTickets for help on using tickets.