Setting the Value of the search/filter input in the Javascript doesnt trigger the filtering.

Setting the Value of the search/filter input in the Javascript doesnt trigger the filtering.

NegadaNegada Posts: 5Questions: 2Answers: 0

Hello,

I gave the search input an id to be able to set its value in the javascript, now i can set the value but that doesnt trigger the filtering.

I need that because i m using it in a embedded device and the value get set via virtual keyboard when user enter the input.

Any idea how can i solve that?

Thank you, negada.

This question has an accepted answers - jump to answer

Answers

  • jellydonutsjellydonuts Posts: 4Questions: 1Answers: 2
    edited November 2016 Answer ✓

    You need to trigger the input object for it to do something... since you're filling it with pre-poluated data, the "paste" trigger should work just fine.

    I use something similar to:

    var data = "abc";
    $('#search-id input').val(data).trigger('paste');
    
  • NegadaNegada Posts: 5Questions: 2Answers: 0

    thank you, that works just fine.

This discussion has been closed.