Combining serverside + DOM?

Combining serverside + DOM?

MarcinMMarcinM Posts: 2Questions: 0Answers: 0
edited August 2010 in General
First of all, thanks for a great piece of software; it's saving us a lot of time and effort with managing user data.

We're using the serverside option since we are anticipating hundreds of thousands of records, and it works great with our mySQL database. Unfortunately, not all of our data is in the database and we don't have access to a couple of *minor* things like sorting or searching :)

Is it possible to tell Datatables to use serverside for pagination and data retrieval, but to sort columns with the data already present in the DOM? Would it also be possible to tell it to filter only the existing data by column? I tried using fnFilter with and without a column specified, but the script simply passes it all to the server.

Thanks for any help.

M.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I'm afraid that this isn't currently possible with DataTables. It assumes that either all logic will be handled on the server-side, or on the client-side. The reason for this is that if the client-side only has a subset of the data available, and the end-user does a filter, then they might incorrectly be told of 'zero matching records' (or some sub-set). It sounds like you are aware of this limitation, but as I say, due to this, it's not something that DataTables supports at this time.

    One option might be to use client-side processing with a Ajax sourced data ( http://datatables.net/examples/data_sources/ajax.html ). You could point the source to a php (or whatever) script which will get you the sub-set you want, and then all processing will be done client-side. Then yo can use the fnReloadAjax plug-in and instruct the table to load a new dataset when required. However, there will be a few complications such as the information element would probably be incorrect...

    How difficult is it to get the rest of the data into the database ;-)

    Regards,
    Allan
  • MarcinMMarcinM Posts: 2Questions: 0Answers: 0
    Well, the problem is that it *is* in the database; but the middleware we are using does not support those features as it wasn't created for the purpose of mass serial retrieval. :) Requirements changed, naturally.

    I've ended up going with server-side processing for searches and put in my own high-level filtering by product. I think it'll suffice. I'm using fnFilter in both cases and handling the sSearch and sSearch_1 in my code.

    Thanks again!
This discussion has been closed.