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 new to choicesjs and just trying it out, late at night, and I am probably missing something obvious.
I just want to modify the choice so that it shows extra custom property values after the label (e.g. item code, description, etc, with a bit of html formatting).
i tried copy-pasting the "more complex" example from the readme into my code and it throws the error template is not defined or similar - i don't know what 'template' refers to in the example code.
The first example under callbackOnCreateTemplates is similarly confusing, as the description mentions 'If you want just extend a little original template then you may use Choices.defaults.templates to get access to original template function' and then fails to describe how. Copy-pasting that also throws an error.
I checked stackoverflow and asked chatgpt for examples, but the responses seem to be for a totally different version as they aren't remotely like the example code in the readme.
The text was updated successfully, but these errors were encountered:
callbackOnCreateTemplates is a function which returns an list of name/functions pairs for creating various templates. Choices.defaults.templates is just the default implementation which can be easily invoked and then you can modify the returned HTML
I'ld recommend posting a jsfiddle version of what you are trying.
I am new to choicesjs and just trying it out, late at night, and I am probably missing something obvious.
I just want to modify the choice so that it shows extra custom property values after the label (e.g. item code, description, etc, with a bit of html formatting).
i tried copy-pasting the "more complex" example from the readme into my code and it throws the error
template is not defined
or similar - i don't know what 'template' refers to in the example code.The first example under callbackOnCreateTemplates is similarly confusing, as the description mentions 'If you want just extend a little original template then you may use Choices.defaults.templates to get access to original template function' and then fails to describe how. Copy-pasting that also throws an error.
I checked stackoverflow and asked chatgpt for examples, but the responses seem to be for a totally different version as they aren't remotely like the example code in the readme.
The text was updated successfully, but these errors were encountered: