Client side row reordering issues

Client side row reordering issues

tadasstyrtadasstyr Posts: 3Questions: 1Answers: 0

Hi, We are using DataTables to edit some data on client side, but we have issues if we use reordering option or if we delete rows.
In general we need functionality which is in this example, but on Client side
https://editor.datatables.net/examples/extensions/rowReorder

Do you have any hints how to update DataTables after we do some manipulation like deleting elements or reordering.
It would be perfect to get same example working on Client side data.

Answers

  • allanallan Posts: 48,686Questions: 1Answers: 7,076 Site admin

    There are a number of RowReorder examples using client-side data manipulation only available here.

    Allan

  • tadasstyrtadasstyr Posts: 3Questions: 1Answers: 0
    edited December 2018

    Thank you. This helped, but now we have this issue

    We have datatable with some rows with reordering enabled. When we move row up or down we get post request with diffs.
    Moving row 2 to position 3 we get:

    action: edit
    data[row_3][readingOrder]: 2
    data[row_3][title]:
    data[row_3][author]:
    data[row_3][duration]:
    data[row_2][readingOrder]: 3
    data[row_2][title]:
    data[row_2][author]:
    data[row_2][duration]:

    Moving row 5 to 1 we get:

    action: edit
    data[row_5][readingOrder]: 1
    data[row_5][title]:
    data[row_5][author]:
    data[row_5][duration]:
    data[row_1][readingOrder]: 2
    data[row_1][title]:
    data[row_1][author]:
    data[row_1][duration]:
    data[row_2][readingOrder]: 3
    data[row_2][title]:
    data[row_2][author]:
    data[row_2][duration]:
    data[row_3][readingOrder]: 4
    data[row_3][title]:
    data[row_3][author]:
    data[row_3][duration]:
    data[row_4][readingOrder]: 5
    data[row_4][title]:
    data[row_4][author]:
    data[row_4][duration]:

    Is it possible somehow to post data only for rows which has been moved?

    Ex. If we drag row 2 to 3 position:
    data[row_2][readingOrder]: 3
    data[row_2][title]:
    data[row_2][author]:
    data[row_2][duration]:

    Ex. If we drag row 3 to 1 position:
    data[row_3][readingOrder]: 1
    data[row_3][title]:
    data[row_3][author]:
    data[row_3][duration]:

  • tadasstyrtadasstyr Posts: 3Questions: 1Answers: 0

    Is it possible ? or maybe it is other easy way to get same result ?

Sign In or Register to comment.