0

I am using Jquery UI autocomplete widget with combobox from here. it's working well but I need to filter the data when the value gets changed from the combo box i.e. from the widget.

I searched tried some code but it's not working

/* Snip */
select: function (event, ui) {
 ui.item.option.selected = true;
 if ('function' == typeof (callback = ui.item.option.parentElement.onchange))
  callback.apply(this, []);
  self._trigger("selected", event, {
  item: ui.item.option
  });
  select.trigger("change");
 },
/* Snip */

Please update me what I am doing wrong. The working example which I am using is available here.

I also get referenced from some link i.e. http://api.jqueryui.com/autocomplete/#event-change and http://www.learningjquery.com/2010/06/a-jquery-ui-combobox-under-the-hood but it's not working for me.

nrsharma
  • 2,532
  • 3
  • 20
  • 36
  • @ManseUK The approch which is used in the example id different and I mark in my question that I use that snippt of code but it's not working for me. Please have a look at fiddle I created and let me know where I did mistake.. – nrsharma Jun 25 '13 at 10:17
  • If you read the answer to the question i linked you will see that the change event wont work on the combobox .. you need to listen to the change event of the underlying select – Manse Jun 25 '13 at 10:18
  • I tried the snipt from the example you mentioned, please see in the fiddle link but it's not working. Can you please update the fiddle accordingly and let me know where I was wrong :). – nrsharma Jun 25 '13 at 10:27
  • @nrsharma Can you please elaborate " I need to filter the data when the value gets changed from the combo box" – Praveen Jun 25 '13 at 11:35
  • After having a closer look I found where I did wrong. i place the change event in the correct place where it should and now it's working for me. Thank you to all for your valuable time. – nrsharma Jun 25 '13 at 11:59

0 Answers0