Filter: startsWith instead of contains?

Filter: startsWith instead of contains?

orange_roughyorange_roughy Posts: 19Questions: 0Answers: 0
edited February 2011 in General
Hi,

The default filtering/search behavior matches rows for items that *contain* the user-entered string. Is there a way to change the behavior to match rows for items that *begin* (startsWith) the user-entered string?

thanks,
orange roughy

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    You can use fnFilter ( http://datatables.net/api#fnFilter ) to pass in a regular expression you want to match on, including 'starts with'.

    Allan
This discussion has been closed.