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

value is not updating on ajax call #197

Closed
vicky8987 opened this issue Apr 22, 2014 · 4 comments
Closed

value is not updating on ajax call #197

vicky8987 opened this issue Apr 22, 2014 · 4 comments

Comments

@vicky8987
Copy link

i have issue with latest "jquery.dropkick.js" and old "dropkick.js" as well. 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'm not able to click on any element. 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 know solutions for getting 2 times dropdowns.
Thanks.

@acemir
Copy link
Contributor

acemir commented Apr 22, 2014

You are using a very outdated version of Dropkick.
The version you're using don't works in IE11.
With the latest version you do not remove and reapply the dropkick, simply call the 'refresh' method after populate your with newer

@vicky8987
Copy link
Author

Thank you very much. It's working in same way as i wanted. Thanks again.

@vicky8987
Copy link
Author

Could you please give me syntax for disable and enable on change event. My previous code stopped working for enable and disable. i was using bellow code to disable and enable:
$('#ddlRebatesModel').attr('disabled', true);
$('#ddlRebatesModel').removeAttr('disabled');

@Robdel12
Copy link
Owner

Should be able to do $('#ddlRebatesModel').attr('disabled', "disabled");

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