search field replace a value

search field replace a value

yskapellyskapell Posts: 47Questions: 14Answers: 3

Hello all,

I search all day yesterday but could not find any reply to my question

I have a code on which to some replacement with specific confition on editor search field .

Everything is ok with the replacement except I cannot change it on the search filed.

for example: if I type a3 instead of getting ǎ I get a3 .

I tried the below but nothing. any idea?

$('#vocabulary_filter').val(s);

Answers

  • kthorngrenkthorngren Posts: 21,351Questions: 26Answers: 4,955

    Use the search() API with the search term. It will update the search input and perform a search of the table.

    Kevin

  • yskapellyskapell Posts: 47Questions: 14Answers: 3

    you mean to add this?

    $('#vocabulary_filter').search(s).draw();
    
  • yskapellyskapell Posts: 47Questions: 14Answers: 3

    I fix it!

    I change

    $('#vocabulary_filter').val(s);
    

    to

    $('#vocabulary_filter input').val(s);
    

    and worked!

  • kthorngrenkthorngren Posts: 21,351Questions: 26Answers: 4,955

    you mean to add this?
    $('#vocabulary_filter').search(s).draw();

    No. search() is a Datatables API. See the examples in the docs. Something like this:

    var table = $('#example').DataTable();
     
    table.search( s ).draw();
    

    Kevin

Sign In or Register to comment.