websemantics / Image-Select

Image Select is an extension of Chosen, a jQuery plugin that makes long, unwieldy select boxes much more user-friendly. It provides image support for Single and Multi select HTML tags.
http://websemantics.github.io/Image-Select
MIT License
148 stars 44 forks source link

Chosen `change()` method issue with Image-Select #32

Closed rafasashi closed 7 years ago

rafasashi commented 7 years ago

I am using chosen together with Image-Select the following way:

                $select .html(html).chosen({width: "100%"})
                .change(function(evt, params){
                    vars.setValue($(this).val());
                })
                .on('chosen:showing_dropdown', function(evt, chosen) {
                    vars.container.parents('.panel').css('overflow','visible');
                });

After adding Image-Select I get the following error:

Uncaught TypeError: Cannot read property 'change' of undefined

I have tested it without using change() method and it works well...

How to implement the change() method with Image-Select?

rafasashi commented 7 years ago

I fixed it... Nothing to do with Image-Select.

                $select .html(html).chosen({width: "100%"});

                $select .change(function(evt, params){
                    vars.setValue($(this).val());
                })
                .on('chosen:showing_dropdown', function(evt, chosen) {
                    vars.container.parents('.panel').css('overflow','visible');
                });
rafasashi commented 7 years ago

I reopened the issue because the image is shown only inside chosen-single but not chosen-drop

screenshot 64

Any suggestions?

rafasashi commented 7 years ago

At the end my chosen.jquery.min.js wasn't up to date...