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
Add option for SELECT OPTION #15
Comments
Hi @xavierfaucon, what about leaving the option value empty so fontIconPicker will use the option text as the value? This one look much like a one case scenario, it would be pointless to add this as an option. |
@micc83 I agree it's a specific scenario but it is linked with Symfony (2nd most popular framework on Github). By default, Symfony forms 'entity' uses the id for the OPTION tag.(http://symfony.com/fr/doc/current/reference/forms/types/entity.html). I don't know if other framework do it the same way :-) Another solution could be to choose the value between the OPTION tags in first choice, then if empty, the value attribute? |
@xavierfaucon I see your point 😄 |
@micc83 and @xavierfaucon, Indeed this is a very specific scenario. To globalize it a little, I was thinking perhaps, we can add an attribute Thoughts? |
I'm not into Symfony (more a Laravel guy 😄 ), i'm not sure how Symfony forms 'entity' works, perhaps @xavierfaucon knows better.... |
@swashata if I understand correctly you propose that the initials OPTIONS from html contains 'data-icon-class'. It could work however this does not remove the pain to tweak an entity form (look at this for example :p :http://stackoverflow.com/questions/20509459/additional-properties-to-entity-field-type-in-a-form-in-symfony2). Why not take the .text() value of the option and if .text() is empty, take the value attribute? (http://learn.jquery.com/using-jquery-core/faq/how-do-i-get-the-text-value-of-a-selected-option/) |
With the intro of #39 I think this becomes useless as one can now render as needed. I will see if any other parameter needs to get exposed. |
Closing as a future commit will expose |
Hello,
When your icon list is constructed in the following way, where 'id' is the database id:
fontIconPicker is going to use the 'id' for the class, as below:
Would that be possible to add an option to specify for SELECT tag to use the OPTION tag's value attributes or the text between OPTION and /OPTION
It would mean using 'flipBoxTitle' instead of 'item' in line https://github.com/micc83/fontIconPicker/blob/master/jquery.fonticonpicker.js#L640
What do you think?
The text was updated successfully, but these errors were encountered: