get different value of order than standard one with rowReorder

get different value of order than standard one with rowReorder

kabedakabeda Posts: 6Questions: 1Answers: 0
edited September 2019 in Free community support

Hi,
In my table I have Id and another column named Order.
I would like to change the order of an article and need the Order value for this.
I didn't find any example. Can some one help me?

  columns: [
            { data: "id", className: 'reorder' },
            { data: "titre" },
            { data: "comments_count" },
            { data: "publication_date" },
            { data: "name", orderable: false, },
            { data: "image", orderable: false, },
            { data: "order_num" },  
            { data: "position" },
        ],

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Replies

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    Hi @kabeda ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • kabedakabeda Posts: 6Questions: 1Answers: 0

    Hi,
    Here it is
    http://live.datatables.net/siwufidi/1/edit?html,js,console,output

    So I need to change the values of Order and get the ID and Order new values,push them in an array.
    The next process is to post them to the server (php).

    Thanks,

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    Hi @kabeda ,

    That information is available in the row-reorder callback - see your example modified here. It's displaying the data of the affected rows in the console.

    Cheers,

    Colin

This discussion has been closed.