Opened 10 years ago

Closed 10 years ago

#9721 closed defect (wontfix)

Digit registry - minor api inconsitency

Reported by: Les Owned by:
Priority: low Milestone: tbd
Component: Dijit Version: 1.3.2
Keywords: registry Cc:
Blocked By: Blocking:

Description

The add() and remove() method signatures are not consistent. You add a widget by passing a widget and remove it by passing the widget id. These two methods should probably accept either an id or a widget as in dijit.byId().

add: function(/*Widget*/ widget){...
remove: function(/*String*/ id){...

dijit.byId = function(/*String|Widget*/id){...

Change History (2)

comment:1 Changed 10 years ago by dante

dijit.WidgetSet? could probably handle add: function(/* String|Widget*/ref) but dijit.registry cannot (despite it being a WidgetSet? instance). Chicken and the egg problem, dijit.registry powers dijit.byId, so trying to .add() a widget by Id to the registry would fail, as it isn't in the registry yet to do a byId lookup.

comment:2 Changed 10 years ago by bill

Resolution: wontfix
Status: newclosed

OK, I'm going to close this as "working as designed". Although we could make remove() also accept a widget, I haven't seen a demand for it, and of course it would slow things down and increase the code size a tiny bit.

Note: See TracTickets for help on using tickets.