simple-datatables icon indicating copy to clipboard operation
simple-datatables copied to clipboard

Support AJAX/Pagination+Search+Sort

Open tacman opened this issue 1 year ago • 5 comments

I understand how to use insert() in order to add new rows, which works great when I simply want to load a bunch of data remotely.

But if the data is big it can become slow, so obviously I can just load part of that data. But then the datatable is only showing the partial data, and the pagination is related to the partial data.

If the library had a way to know the maximum number of items, the pagination could be based on that number, rather than the number of actual items. Of course, if someone clicked on a page (or sort, filter, etc.), it would need to make a callback to properly fetch the data.

I realize this isn't trivial, but would be a cool feature.

tacman avatar Jul 02 '24 12:07 tacman

@tacman I agree, that would be a nice addition. However, with a lot of the data not being available, the table cannot really do a lot of calculations, for example how wide a specific column should be given some settings, etc. .

johanneswilm avatar Aug 21 '24 08:08 johanneswilm

Makes sense. it could default to treating the first X number of rows (from the ajax source) as if the data were in the HTML. Or allow the developers to set those attributes. Just brainstorming.

tacman avatar Aug 21 '24 11:08 tacman

any news?

walirt avatar Sep 16 '24 14:09 walirt

@walirt Will you implement it? I have no use for such a feature personally.

johanneswilm avatar Sep 16 '24 15:09 johanneswilm

@walirt Will you implement it? I have no use for such a feature personally.

This is a common function of the data table, we generally do not return all the data from the api, but paging to return data

walirt avatar Sep 16 '24 15:09 walirt