You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when needing to create tagsinputs with any options we need to destroy/re-create the tagsinput elements that are created when select tags contain the data-role=tagsinput data attribute. To avoid this, plus to add a very useful way to create tailored tagsinputs without needing any javascript (just the data-role=tagsinput data attribute), I'd like to suggest an improvement that would allow settings most of the settings via data attributes.
My thinking is to use the same standard camelCase-to-hyphenated approach:
Option
data- Attribute Equivalent
tagClass
data-tag-class
tagClass
data-tag-class
itemValue
data-item-value
itemText
data-item-text
maxTags
data-max-tags1
confirmKeys
data-confirm-keys2
maxChars
data-max-chars1
trimValue
data-trim-value3
allowDuplicates
data-allow-duplicates3
focusClass
data-focus-class
freeInput
data-free-input3
cancelConfirmKeysOnEmpty
data-cancel-confirm-keys-on-empty3
1: These would need to be cast to numbers 2: The value would need to be a comma-separated list, which would be split to create the array. 3: There are multiple ways to handle booleans, but the easiest is to just do string comparison against "true"/"false".
The only two options that would be omitted are typeahead and onTagExists, unless someone can think of a way to incorporate those.
Thoughts?
The text was updated successfully, but these errors were encountered:
Currently, when needing to create
tagsinputs
with any options we need to destroy/re-create thetagsinput
elements that are created when select tags contain thedata-role=tagsinput
data attribute. To avoid this, plus to add a very useful way to create tailoredtagsinputs
without needing any javascript (just thedata-role=tagsinput
data attribute), I'd like to suggest an improvement that would allow settings most of the settings via data attributes.This has been done on various packages for convenience sake.
Example: bootstrap-datetimepicker
My thinking is to use the same standard camelCase-to-hyphenated approach:
data-
Attribute EquivalenttagClass
data-tag-class
tagClass
data-tag-class
itemValue
data-item-value
itemText
data-item-text
maxTags
data-max-tags
1confirmKeys
data-confirm-keys
2maxChars
data-max-chars
1trimValue
data-trim-value
3allowDuplicates
data-allow-duplicates
3focusClass
data-focus-class
freeInput
data-free-input
3cancelConfirmKeysOnEmpty
data-cancel-confirm-keys-on-empty
31: These would need to be cast to numbers
2: The value would need to be a comma-separated list, which would be split to create the array.
3: There are multiple ways to handle booleans, but the easiest is to just do string comparison against "true"/"false".
The only two options that would be omitted are
typeahead
andonTagExists
, unless someone can think of a way to incorporate those.Thoughts?
The text was updated successfully, but these errors were encountered: