Its possible keep the select when the data comes from ajax?

Its possible keep the select when the data comes from ajax?

waswas69waswas69 Posts: 3Questions: 2Answers: 0

I need to use the pagination and while keeping the selections that come in an ajax request, Its possible?

Example:
Page one you select two rows, and then you call request ajax, and the page four of datatable you selec other two, and
you would have four rows. If you order the datatable by name you would keep the results

Thanks

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    You don't say, but I'm presuming that you are using serverSide? I presume that, since this issue wouldn't occur with client-side processing.

    With server-side processing the problem is that the client-side only retains the rows that are currently shown - that's the whole point of server-side processing, so the other rows aren't really selected on the client-side any more since they no longer exist on the client side.

    A a few options:

    1. Don't use server-side processing (you would only need it if you have tens of thousands or more records)
    2. Implement some kind of selection memory for when changing pages, so that if items were selected they can be reselected when redrawn.
    3. Implement row selection on the server-side rather than client-side.

    Allan

  • waswas69waswas69 Posts: 3Questions: 2Answers: 0

    oks thank

This discussion has been closed.