Server side, Searching and Paged Results

Server side, Searching and Paged Results

Tom_TTom_T Posts: 24Questions: 3Answers: 0

I've only just started using DataTables with server side ajax to an LDAP database. I can't link to a test case as this is running internally with no option to make it publicly accessible.

When my page loads it shows the first xx rows of data based on the option selected in the Show Entries dropdown. This works fine and it I change it to 20 or 50 the page updates with that number of records.

With the Show Entries set to 10 I enter a value in the search field. The database is searched and 200 entries out of 2000 are found and returned to DataTables, however all 200 displayed in one long page, not just 10 and then page options for the rest.

I was expecting the 200 entries to be returned to DataTables, it to show a table with only 10 entries and using the First, Prev, Next and Last buttons they would only work on those 200 entries.
When I click them another database lookup is done passing the same search value.

Is that normal or should it page the results returned ?
Any advise on this ?

Thanks

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Yep, that's what should happen - see example here. This is most likely caused by your server-side script. Are you using one of ours, or is it customised or developed by you?

    Colin

  • Tom_TTom_T Posts: 24Questions: 3Answers: 0

    Hi Colin,
    This is a custom script, can you point me to the examples please.
    Is there one for LDAP ?

    Thanks

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    There is an LDAP script, just PHP. The protocol is discussed here. Also see examples here. If you download the DataTables repo, there are examples of the server-side scripts in /examples/server_side/scripts,

    Cheers,

    Colin

Sign In or Register to comment.