revsystems / jQuery-SelectBox

A modern replacement for the traditional select element. Increases flexibility and stylability.
http://plugins.jquery.com/project/jquery-sb
Other
72 stars 16 forks source link

Subsequent Changes Aren't Taking After Refresh #18

Closed zeroelink closed 13 years ago

zeroelink commented 13 years ago

When I first update the select box then do a refresh, everything updates accordingly. But after each subsequent update and refresh, the select box is not updated. Here is a snippet of code I'm using to update the select box:

$.ajax({ type: "GET", dataType: "json", url: "/guests/get/" + this.value, success: function(data) {

        $("#guest_id_number_type").val(data.guest.id_number_type);
        $('#guest_id_number_type').sb('refresh');            

      }
revsystems commented 13 years ago

Confirmed, I'll try to get up a fix for it quickly.

Thanks for the report.

revsystems commented 13 years ago

Btw, in the meantime, I think the old syntax is still working correctly. You could use that instead if you need a quick fix:

$("#guest_id_number_type").val(data.guest.id_number_type).triggerHandler("reload").

EDIT: It might not have been given the type of error I found.

zeroelink commented 13 years ago

cool. thanks

revsystems commented 13 years ago

Just pushed a change that should fix the issue. The destroy function was unintentionally destroying the accessor object. So it would work the first time, then the accessor would be gone and your calls wouldn't do anything.

Let me know if the change works for you. Thanks

zeroelink commented 13 years ago

great. i'll test it out and let you know..thanks for the quick response

zeroelink commented 13 years ago

working correctly now.