Get selected rows from server-side Javascript (ssjs)

Get selected rows from server-side Javascript (ssjs)

ImendanImendan Posts: 9Questions: 2Answers: 0

I tried and read a lot, but I did not understand how to get selected rows from ssjs. I made this - "serverSide": true . Please, can you give me direction or working example?

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Server-side processing documentation is here:
    https://datatables.net/examples/data_sources/server_side.html

    It has all the example code you need.

    I have no idea what you mean by "ssjs".

  • ImendanImendan Posts: 9Questions: 2Answers: 0

    Ssjs - server-side javascript.

    There is no example with getting selected rows from server-side in your link.

    Or may be you will put some code for example?

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    In that case I don't understand your question.
    You can "select" in the example by using the search input box. Otherwise what do you mean by "selected rows"? How are you selecting rows? What is your data source? What are you not seeing in the example?

  • ImendanImendan Posts: 9Questions: 2Answers: 0

    There is not problem with selection. All works well.

    My problem is to get selected rows and to send those data to the server.

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923

    There are many ways to select rows which is what Tangerine is asking. This example shows how to get the selected rows if you are using the Select Extension.

    Kevin

  • ImendanImendan Posts: 9Questions: 2Answers: 0

    From client-side JavaScript all works perfect. But I don't know how to get that from server-side code (may be there any example with server-side java?).

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923
    edited November 2020

    Again you haven't explained how you are selecting the rows. I understand its working but without knowing this its impossible to give specific suggestions. However this Editor checkbox example may help. If you want to store the state of the row selection in a table then you will need a field to do so. In this example the field is toggled 1 for checked (or selected) and 0 fo unchecked.

    But I don't know how to get that from server-side code may be there any example with server-side java?

    Are you using Java or Javascript in the server?

    Depending on you you are selecting the rows you will use rows().data() with a row-selector to get the selected row(s) data. Then use whatever technique is needed to send that Javascript object data to your server side.

    Kevin

This discussion has been closed.