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
I am maintaining a project that is using selectize for its dropdowns. What I am trying to do is to retrieve data from data-* attributes so I can use that data when rendering, specifically, I want to pass through data attribute an image url so I can associate each option to its corresponding image.
According to docs, there is a dataAttr Selectize option, which default value is 'data-data' so I tried to include that attribute on HTML.
<option value="demovalue" data-data="{literal}{'demo': 'demo'}{/literal}">text</option>. I am using {literal} tags as I am using Smarty.
I am maintaining a project that is using selectize for its dropdowns. What I am trying to do is to retrieve data from data-* attributes so I can use that data when rendering, specifically, I want to pass through data attribute an image url so I can associate each option to its corresponding image.
According to docs, there is a dataAttr Selectize option, which default value is 'data-data' so I tried to include that attribute on HTML.
<option value="demovalue" data-data="{literal}{'demo': 'demo'}{/literal}">text</option>
. I am using {literal} tags as I am using Smarty.And I am trying to retrieve data like this:
I also tried adding
dataAttr: 'data-data'
to selectize options, but with the same result.I am unable to get this data attribute on Javascript code. I saw a lot of examples on the internet even here on old tickets but I cannot it work.
Is it a bug?
NOTE: I am using v0.13.5 of Selectize and Smarty as PHP framework.
The text was updated successfully, but these errors were encountered: