Can we search DataTable on full word instead of each letter typed

Can we search DataTable on full word instead of each letter typed

hriteshhritesh Posts: 1Questions: 1Answers: 0

Hi,

I am trying to search a term on full word rather than on each letter typed..

Thanks

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    The built in input will always search on each key press. It uses sub-string matching for things like "some" / "something" / "someone".

    If you want to do full word matching you could use a regular expression with search() - e.g. table.search('^allan$', true, false).draw();.

    Allan

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @hritesh ,

    The standard search doesn't support that - you can delay the sending with searchDelay but that's as far as it goes. That said, you could remove the standard search in the dom and create a custom search element instead that does do what you want (this demonstrates a custom search),

    Cheers,

    Colin

This discussion has been closed.