Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance data plugin attribs for using inputs with multiple jquery plugins #6

Closed
kartik-v opened this issue Nov 25, 2014 · 2 comments
Closed

Comments

@kartik-v
Copy link
Owner

For InputWidget, currently for each input, the two HTML5 data attributes are being generated:

  • data-plugin-name the name of the plugin
  • data-plugin-options the client options of the plugin

This works for most use cases when a single jQuery plugin is attached. However, when more than one jQuery plugin is attached to the input - it will overwrite to the last plugin registered.

A BC breaking fix will be provided for a way to register multiple plugins.

@kartik-v
Copy link
Owner Author

Resolved via upgrade to release v1.3.0.

Removed:

The following HTML5 data attributes are removed and not registered anymore with the input:

  • data-plugin-name the name of the plugin
  • data-plugin-options the client options of the plugin

Added:

The following HTML5 data attribute will be added for each input:

  • data-krajee-{name} the client options of the plugin. The tag {name} will be replaced with the
    registered jQuery plugin name (e.g. select2, typeahead etc.). So this data attribute will be named something like data-krajee-select2, data-krajee-typeahead etc.

@thiagotalma
Copy link

Very nice!
For a cleaner HTML, how about: data-kj-select2, data-kj-typeahead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants