Opened 13 years ago

Closed 13 years ago

#6891 closed feature (fixed)

Widget: Improve API for direct instantiation

Reported by: Scott González Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.widget Version: 1.8.8
Keywords: Cc:
Blocked by: Blocking:


When instantiating a widget directly (new $.ui.dialog( options, element )), the following should be improved:

  • The new keyword should be optional
  • When not using the new keyword, the widget should be initialized even if called with no parameters
    • When called with the new keyword, the widget should not be initialized to allow the simple inheritance pattern to continue to work
  • The widget should be able to generate an element if one is not provided
  • Providing a selector or jQuery object instead of a DOMElement should fully work
    • Currently the widget will be instantiated and this.element will be correct, but the instance will not be stored as data on the element

Change History (1)

comment:1 Changed 13 years ago by Scott González

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.