Good morning. In a generic search, on the server, the search string is in $_POST['search']['value'];

Good morning. In a generic search, on the server, the search string is in $_POST['search']['value'];

ANGELDSANGELDS Posts: 5Questions: 1Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

This question has an accepted answers - jump to answer

Answers

  • ANGELDSANGELDS Posts: 5Questions: 1Answers: 0

    Sorry, I put the text in the title. If an administrator can delete it, I appreciate it...

  • ANGELDSANGELDS Posts: 5Questions: 1Answers: 0

    My question is the equivalent of sSearch_0 of DataTables 1.9 in DataTables 1.10....For example, the one of sSearch is search ( $_POST['search']['value'] ), but to search in the first column I tried with $_POST['search_0']['value'] and it does not work for me ...

  • kthorngrenkthorngren Posts: 21,337Questions: 26Answers: 4,954

    Sounds like you are asking about the parameters sent when using server side processing with Datatables 1.10. See the Server Side Processing docs for the parameters.

    If this doesn't help then please provide more details about your questions.

    Kevin

  • ANGELDSANGELDS Posts: 5Questions: 1Answers: 0

    Thank you very much, Kthorngren. Yes, it is because of the parameters sent to the server...

    Read value

    $draw = $_POST['draw'];
    $row = $_POST['start'];
    $rowperpage = $_POST['length']; // Rows display per page
    $columnIndex = $_POST['order'][0]['column']; // Column index
    $columnName = $_POST['columns'][$columnIndex]['data']; // Column name
    $columnSortOrder = $_POST['order'][0]['dir']; // asc or desc
    $searchValue = $_POST['search']['value']; // Search value

    These work well for me, but with
    $campo_Gender = $_POST['colums'][2]['search']['value']; // tfoot
    does not filter in the column. However, if I directly assign the value
    $campo_Gender= "COUI";
    $searchQuery .= " and location like '%".$campo_Gender." %'";
    if it works...

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Answer ✓

    If you post a link to a test case showing the issue, I'd be happy to take a look.

    I'd also note that:

    $_POST['colums'][2]['search']['value'];
    

    has a typo. colums should be columns. That alone might be the issue.

    Allan

  • ANGELDSANGELDS Posts: 5Questions: 1Answers: 0

    Yes!!! It was that. Thanks a lot!!!

Sign In or Register to comment.