-
Hi, I'm trying to integrate Tom-select library into my symfony project. How can I do to keep my classes ? I know there is a render function mentioned into the documentation : but it's seems to only work with options that are created into the javascript ("options" member with list), not the original HTML elements... Sorry, my english is not very good. Nevertheless, I hope you understand what I mean. Thank you for your help. -- |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi Sylvain, You could use a custom render method to add a custom class to all options |
Beta Was this translation helpful? Give feedback.
-
Alright, this can be done now with v1.4 like so: new TomSelect("#select-beast",{
render: {
option: function(data, escape) {
return '<div class="' +escape(data.$option.className) +'">' + escape(data.text) + '</div>';
},
}
}); |
Beta Was this translation helpful? Give feedback.
Alright, this can be done now with v1.4 like so: