Hello, everyone!
Great tip by Jens about OptionModel attributes!
If you didn't need to have data-attributes, you could style the select
options using CSS attribute selectors:
option[value="fa-globe"]::before {
content: url(url/to/fa-globe/image.png)
...
}
On Thu, Nov 15, 2018 at 9:37 AM Je
Hi David/Ben
The SelectModelRender makes use of attributes by
...
writeAttributes(optionModel.getAttributes());
...
And this method is implemented first in "AbstractOptionModel" and
returns "null".
So as Ben stated just adding the entry
"data-icon" -> "glyphicon glyphicon-eye
Hi,
as far as I can tell from the code and documentaion the class OptionModel
supports additional attributes with its .getAttributes() method. So you
should only need to implement your own OptionModel and build your
SelectModel with it.
Hope this helps.
Ben
On Thu, Nov 15, 2018 at 7:23 JumpStar
Very good question. I don’t know the answer, but here’s an idea…
The Select component does not have a class parameter, but it does render
informal parameters. So if you specify class=“selectpicker” then I’d expect it
will be rendered with class=“selectpicker”. By default it renders the "select"