We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
Thanks for this great plugin. I am really searching for same (Custom HTML Select with icons).
I just need to display selected icon in selected item. Currently it is displaying only text in selected item.
Thanks again.
The text was updated successfully, but these errors were encountered:
hi,
Vijay you need to edit the plugin code.
Edit those two lines 188 and 416
for exaple you can change those lines to something like that: $label.html(''+_this.items[currValue].text);
hope it will solve your problem
Sorry, something went wrong.
I made the following change where $label.html is
// I added another option called optionsTrigger ... optionsTrigger: '{text}', optionsItemBuilder: '{text}' // function(itemData, element, index) ... // then added this: var triggerBuilder = _this.options.optionsTrigger $label.html($.isFunction(triggerBuilder) ? triggerBuilder(_this.items[currValue].element) : _this.items[currValue].text);
then when you call selectric you can pass in the option which you can provide a function with the element:
$().selectric({ optionsTrigger: function(element) { return '<div>' + element.data('something') + '</div>'; } });
Added new option in v1.9.2, using the select with icons from the demo, using the sames classes it would look like this:
$('.customOptions').selectric({ optionsItemBuilder: function(itemData, element, index) { return element.val().length ? '<span class="ico ico-' + element.val() + '"></span>' + itemData.text : itemData.text; }, labelBuilder: function(currItem) { return (currItem.value.length ? '<span class="ico ico-' + currItem.value + '"></span>' : '') + currItem.text; } });
No branches or pull requests
Hi,
Thanks for this great plugin. I am really searching for same (Custom HTML Select with icons).
I just need to display selected icon in selected item. Currently it is displaying only text in selected item.
Thanks again.
The text was updated successfully, but these errors were encountered: