table search results showing on the second page

table search results showing on the second page

jw3jw3 Posts: 3Questions: 1Answers: 0

Hi,
I'm using the search function on a specific column using this code snippet:
oTable.column( 5 ).search( search_string, true, false ).draw();

The search string is "Magic Command Fest"
I am selecting to show 25 results per page.
The first page tells me there are no results. I have to go to page 4 to see the filtered result.

Here is where you can reproduce the error:
https://judgeacademy.com/events/
Select a category "Magic Command Fest"

How I can render the valid results on the first page of the table?

Thanks,
Joanna

This question has an accepted answers - jump to answer

Answers

  • tangerinetangerine Posts: 3,348Questions: 36Answers: 394
    Answer ✓

    Your "Category" column is actually column 6.

  • jw3jw3 Posts: 3Questions: 1Answers: 0

    Interesting. It looks like it, but this is the column index that filters that column.

  • kthorngrenkthorngren Posts: 20,292Questions: 26Answers: 4,768

    You have server side processing enabled. Your server scrip tis responsible for searching, sorting and paging. When you search you can see this search term sent along with all the other SSP parameters:

    columns[5][search][value]: Magic Command Fest

    The XHR response looks like this:

    {
        "recordsTotal": "139",
        "recordsFiltered": 114,
        "data": []
    }
    

    Your server script isn't returning the rows for the page.

    You have 139 rows in the table which means you don't need to enable server side processing. Try disabling it to load all the rows in the client and allow the client to perform searching, sorting and apging.

    KEvin

  • jw3jw3 Posts: 3Questions: 1Answers: 0

    Thanks! I was able to track down the column number discrepancy and fix the problem.

Sign In or Register to comment.