Order used here affect rowReorder so how we use both.

Order used here affect rowReorder so how we use both.

shaliniSinghshaliniSingh Posts: 4Questions: 2Answers: 0
edited June 2019 in Free community support
 table.dataTable({
            "order": [],
            "searching": false,
            "paging": false,
            "info": false,
            "colReorder": {
            realtime: false
            },
            rowReorder: {
            selector: 'tr'
            },
            "autoWidth": false 
        });

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

Answers

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

    Hi @shaliniSingh ,

    Can you give more details - why doesn't it work for you? Also, 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

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

    Here, it's working as I'd expect, so please provide more info.

  • shaliniSinghshaliniSingh Posts: 4Questions: 2Answers: 0

    Hey Collin ,
    Thanks for your reply but check row ordering not working properly in your tesr example whenever we drag and drop to our desired position this always move to one place only and only for first column data not other columns drag and dropped.

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin

    That is correct and expected. Our RowReorder extension doesn't move the DOM elements (since a DataTables reorder would just put them back where they were!). Instead it uses a data-swap method. Its easiest to use Editor as an example for this. When editing the row order you want to change the value being used in the column sorting is based on (anything else doesn't really make much sense for editing). So that's what RowReorder does - it changes the values so the ordering now makes sense.

    It sounds like you were expecting something more like jQuery UI sortable where the DOM defines the order of the rows. But that isn't the case in DataTables. Its always the data that defines the order.

    Allan

This discussion has been closed.