Define in which columns(sql database) searchbox is allowed to search

Define in which columns(sql database) searchbox is allowed to search

mbcl88mbcl88 Posts: 13Questions: 5Answers: 0

Hello,

i'm using datatables serverside processing, and having problems because in sql database i have some INT columns, and when i type letters in searchbox on datatables page im getting error sometimes "DataTables warning: table id=example - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1"

Can i somehow define in which columns exactly i want to search through search input?

ty

Answers

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923

    You can use columns.searchable to define which columns to search. But your server script will need to adhere to that configuration. If you are using a Datatables supplied server side processing script then it should be all you need.

    Kevin

  • mbcl88mbcl88 Posts: 13Questions: 5Answers: 0

    Yea i use ssp class for serverside processing, but i still dont know how i can configure it to fix my problem :smile:

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923
    edited December 2020

    You set the column you don't want searched using columns.searchable to false. The ssp-class.php script follows the SSP protocol described here and will perform the search only if that column has searchable set true.

    Kevin

This discussion has been closed.