Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9362 closed feature (wontfix)

Enable widgets to automatically extract their own options from an attribute on the element.

Reported by: jsm11482 Owned by:
Priority: minor Milestone: none
Component: ui.widget Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:

Description

I currently define options for my widgets in an attribute on the element. But I think it would make for a simple and useful addition to the main jQuery UI library. To best understand what I mean, please see this example.

This would allow us to easily define the options for our widgets inline with the actual widget (instead of in a script somewhere). It's very helpful for dynamically generated pages with many widgets with different configurations.

Change History (5)

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

Component: ui.coreui.widget
Resolution: wontfix
Status: newclosed

You can already build whatever logic you want with _getCreateOptions(). We're not going to build this into jQuery UI.

comment:2 in reply to:  1 Changed 7 years ago by jsm11482

I was not aware of that function , I'll take a look. Thanks.

comment:3 Changed 7 years ago by jsm11482

Can you elaborate regarding how I could use apply a specific function to the _getCreateOptions() for all widgets? Is there a way to do this?

comment:4 Changed 7 years ago by Scott González

Change $.widget._getCreateOptions(). Please ask for help on IRC, the forums, or Stack Overflow.

comment:5 Changed 7 years ago by jsm11482

Thank you, sorry for asking that here, I realize it's not the right place. I'm done. :)

Note: See TracTickets for help on using tickets.