-
Notifications
You must be signed in to change notification settings - Fork 14
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
Server Side data return not working #7
Comments
hey @Fzoltan87, if you want it to work after you load the data from the server side, add the dselect after you load the $("#states") data, success: function(data) { same for the cities one. I had the same issue and that was the best way i could make it work. |
Hy, Do you only need to call the dselect function here (success:function(data))? You don't need this code then? |
the reason why it's not working, is because you're adding to the #states and #cities dynamically (aka from the server) after you load the page. the javascript code would work if you were loading that data at the beginning. I have a main dropdown that has all the data populated for example #states only and use the javascript for that one. then when #states changes, update cities and use the dselect on success to update the #cities one to use it. (or you can get rid of the javascript code in general and use: $(document).ready(function () { but you still need the dselect at the bottom of success for it to register that you want to use dselect on that dropdown. |
I managed to solve it.
|
The data coming from the server side is not loaded into the dropdown list when we add dselect (If I don't use the dselect add-on, the data reload works).
The code HTML:
Javascript code: (#states and #cities select tag ID)
The text was updated successfully, but these errors were encountered: