Skip to content
New issue

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

Images/Glyphicons in operators dropdown list #603

Closed
maciejkaiser opened this issue Dec 1, 2017 · 3 comments
Closed

Images/Glyphicons in operators dropdown list #603

maciejkaiser opened this issue Dec 1, 2017 · 3 comments
Labels
feature New feature
Milestone

Comments

@maciejkaiser
Copy link

Is there any possibility to add a glyphicon or image (with html tag) to the dropdown list for operators i.e. "equal": "<img src='/img/equals.png' /> equals" or "equal": = "<span class='glyphicon glyphicon-whatever'></span> equals" ?

@mistic100
Copy link
Owner

The dropdown is a <select> it cannot contains anything other than text.

Give it a try with bt-selectpicker plugin http://querybuilder.js.org/plugins.html#bt-selectpicker

@maciejkaiser
Copy link
Author

Ok, but how to add any icon to the translate file?

"operators": { "equal": "<span class='glyphicon glyphicon-heart'></span> equal", "not_equal": "not equal",
etc.

bt-selectpicker allows to use data-icon, but how to use it with your plugin :( ?

<select class="selectpicker">
  <option data-icon="glyphicon-heart">Ketchup</option>
</select>

http://silviomoreto.github.io/bootstrap-select/examples/#customize-options

mistic100 added a commit that referenced this issue Jan 6, 2018
@mistic100 mistic100 added this to the 2.4.6 milestone Feb 26, 2018
@mistic100 mistic100 added the feature New feature label Feb 26, 2018
@mistic100
Copy link
Owner

You can use the icon property of each filter, it will just add the data-icon attribute to the generated HTML.
Plugin BT Selectpicker supports this by default for font-icons.

You can still write your own plugin for advanced usage (images, etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

No branches or pull requests

2 participants