tristanjahier / chosen-order

Chosen Order is a plugin for Chosen which provides functions to handle the order of the selection
http://labo.tristan-jahier.fr/chosen_order/
Other
53 stars 26 forks source link

Error get values multiple #12

Open iLenTheme opened 7 years ago

iLenTheme commented 7 years ago

Hello, in chosen version v1.6.2 I added the chosen.order.jquery.min ok, But at the moment of obtaining the values ​​sends me an error in your script

My html

<select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select" style="width:350px;" tabindex="18" id="multiple-label-example">
            <option value=""></option>
            <option>American Black Bear</option>
            <option>Asiatic Black Bear</option>
            <option>Brown Bear</option>
            <option selected>Giant Panda</option>
            <option>Sloth Bear</option>
            <option>Sun Bear</option>
            <option>Polar Bear</option>
            <option>Spectacled Bear</option>
          </select>

My jquery

<script>
jQuery(document).ready(function( $ ){
      var $ = jQuery;
   $("#btn_order").on("click",function(){
      var selection = $('#single-label-example').getSelectionOrder();      
      console.log( selection );
   });

});
</script>

the error http://i.imgur.com/SZbouQM.png

What could be happening?

tristanjahier commented 7 years ago

Because you are using Chosen 1.6.2, it makes me think of this pull request #10 which is supposed to fix a problem. I did not look into it much yet because I'm lazy but you can check this out and see if that solves the problem. Alternatively you could use a Chosen version prior to 1.6.

Let me know what works for you!

tristanjahier commented 7 years ago

@iLenTheme The PR I mentioned (#10) is completely incorrect, so forget about it. I've just tested Chosen 1.6.2 and 1.7.0 and my plugin still works. Without a response from you, I'll close this issue because I can't reproduce the problem.