Skip to content
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

Updating the dropkick. #61

Closed
Cinojose opened this issue Apr 20, 2012 · 1 comment
Closed

Updating the dropkick. #61

Cinojose opened this issue Apr 20, 2012 · 1 comment

Comments

@Cinojose
Copy link

If i want to change the values of one of the Dropkick dynamically using ajax, How can i append the values to the Dropkick.
thanks in Advance

@vicky8987
Copy link

i have the same issue with latest "jquery.dropkick.js". I was using your old dropkick.js. now it's stopped working for IE11. e.g: http://www.intellichoice.com/certified-pre-owned.html . Refer cpohome.js, I searched but found that everyone is saying to updated dropkick version.
But with updated one I'm stuck. I'm not able to update dropkick value in an ajax call.
code bellow:
success: function(response) {
optionData = "";
optionData += "Model";

                    var json = jQuery.parseJSON(response);
                    $.each(json, function() {
                        var modelId = this.VehicleModelId;
                        var model = this.VehicleModel;
                        optionData += "<option value='" + modelId + "'>" + model + "</option>";
                    });
                    alert(optionData);
                    $select = $("#ddlModel_2");
                    $select.removeData("dropkick");
                    $("#dk_container_ddlModel_2").remove();
                    $select.html(optionData);
                    optionData = '';
                    $("#ddlModel_2").dropkick({
                        change: function(value, label) {
                            $('#VehicleModel').val(label);
                            $('#vehicle.model').val(value);
                        }
                    });

                }

from above code due to line "$("#dk_container_ddlModel_2").remove();" my dropdown is getting removed, but if I'm continue with the line I'm getting two dropdowns, first one with old value and second with new Ajax value.
Please suggest what to do, should i use old version then let me know solutions for IE11 or should i use old one, then tell me solutions for getting 2 times dropdowns.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants