jQuery autocomplete filtering incorrectly -
i have input field has auto complete jquery field.
<input id="peoplerolecodeauto" type="text" size="50"/>
that when type "a" see "atpl" value listed. when type "at" disappears, when type "atp" shows again. have limited jquery exposure , wondered if had suggestions.
jquery('#peoplerolecodeauto').icisautocomplete({ source: rolecodes, localjson: true, mustmatch: true, linkedfields: ['peoplerolecode', 'peoplerolecodedescription'], select: function(event, ui){ jquery('#peoplerolecode').val(ui.item.id); jquery('#peoplerolecodedescription').val(ui.item.desc); }, change: function(event, ui){ jquery('#peoplerolecode').val(ui.item.id); jquery('#peoplerolecodedescription').val(ui.item.desc); } }) function icisautocomplete(param, parentelem){ return { source: param['source'], select: param['select'], search: param['search'], response: param['response'], focus: param['focus'], success: param['success'], change: function (event, ui) { if(jquery(this).val() == ''){ jquery(param['clear']); } if(param['mustmatch'] && ui.item == null){ jquery(this).val(''); if(param['linkedfields']){ clearfields(param['linkedfields']); } } else{ if(param['change']){ jquery(param['change'](event, ui)); } } if(param['fieldstoresetonchange']){ clearfields(param['fieldstoresetonchange']); } }, minlength: (param['allopt'] ? 0 : (!jquery.isnan(param['minlength']) ? param['minlength'] : 1)), allopt: (param['allopt'] ? true : false), delay: 0, autofocus: true }; }
thanks,
tom
this started working once add following code searchon: "id", our jquery code
jquery('#peoplerolecodeauto').icisautocomplete({ source: rolecodes, localjson: true, mustmatch: true, linkedfields: ['peoplerolecode', 'peoplerolecodedescription'], searchon: "id", select: function(event, ui){ jquery('#peoplerolecode').val(ui.item.id); jquery('#peoplerolecodedescription').val(ui.item.desc); return false; }, change: function(event, ui){ jquery('#peoplerolecode').val(ui.item.id); jquery('#peoplerolecodedescription').val(ui.item.desc); return false; } })
Comments
Post a Comment