mercredi 30 avril 2014

JQuery AutoComplete Selected Value Undefined in Update Mode


Vote count:

0




I Implemented JQuery Autocomplete ,But In Insert Mode its Working fine,But In Update Mode i am Getting Undefined. Here i Wrote my Code .So Please Help Me anyone. This is the Code. $(document).ready(function () { $.ajaxSetup({ cache: false }); var GetListUrl = '/Manager/GetManagersList'; Managers("ParentName");

function Managers(groupCtrlId) { $('#' + groupCtrlId).autocomplete({ source: function (request, response) { $.ajax({ url: GetListUrl, data: "{ 'prefixText': '" + request.term + "' }", dataType: "json", type: "POST", contentType: "application/json; charset=utf-8", success: function (data) { response(data) }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert('Error occured while autocomplete'); } }); }, select: function (event, ui) { $("#" + this.id).val(ui.item.Text); $("#" + this.id.replace("Name", "Id")).val(ui.item.Value); return false; }, minLength: 1, change: function (event, ui) { $("#" + this.id).val(ui.item.Text); $("#" + this.id.replace("Name", "Id")).val(ui.item.Value); return false; //ProductGroupOnChange(this.id.replace("Name", "Id")); } }) .data("autocomplete")._renderItem = function (ul, item) {

return $("


").attr('class', 'autocompleteresults').append($("" + item.Text + "").html(item.Text)).appendTo(ul); }; } });


asked 42 secs ago






Aucun commentaire:

Enregistrer un commentaire