How do We Search A Records In Datatables On Input Focus ?

How do We Search A Records In Datatables On Input Focus ?

Sanit KaleSanit Kale Posts: 23Questions: 9Answers: 0
  1. I Am Passing Value In Search Box Using Jquery But it's not working for search I Have to move my cursor Then it's working (maybe search box default event is keyup ) so how do I make work when it gets focused.

                $('#ga-search').val(startdate);
    
    
                $('#employee-grid_filter input[type=search]').focus();
    

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓
    $('#ga-search').val(startdate).trigger('change');
    

    should do it.

    Allan

  • Sanit KaleSanit Kale Posts: 23Questions: 9Answers: 0
    edited March 2018

    Thanks, Sir, I just Replaced Change with Keyup now its working

       $('#ga-search').val(startdate).trigger('keyup');
    
This discussion has been closed.