New RowReorder Extension seems to mess with the table

New RowReorder Extension seems to mess with the table

jLinuxjLinux Posts: 981Questions: 73Answers: 75
edited August 2015 in Free community support

I have a DataTable setup on my app, and the radio buttons and check boxes use the jQuery Labealauty pluign: http://fntneves.github.io/jquery-labelauty/

Heres a screenshot of the table before anythings re-ordered: http://d.pr/i/10Qdv
Now when I try to drag the Server Name row down below the Chef Recipes row, heres the table after: http://d.pr/i/19WMi

Notice it clears out the check boxes/radio buttons, and also doesnt seem to re-order the row....

I know this is a new extension, but what can I do to see why this would cause an issue?

Code:

var t = $attributes_table.DataTable({
            rowReorder: true,
            bPaginate: false,
            bFilter: false,
            bSort: false,
            fnCreatedRow: function( nRow, aData, iDisplayIndex ) {
                $( nRow ).attr( 'data-position', iDisplayIndex);
                $( nRow ).attr( 'data-row-id', iDisplayIndex);
                $( nRow ).attr( 'id', iDisplayIndex);

                // Start the labelauty plugin on the visible/primary/required/unique radio/check boxes
                $( nRow ).find(":checkbox.labelauty").labelauty({ label: false });
                $( nRow ).find(":radio.labelauty").labelauty({ label: false });

                $( nRow ).find('td:nth-child(1)').addClass('align-center');
            }
        });

Edit: I know how to fix the labeauty issue now actually, but still wondering why the re-order doesnt work.

P.S: No errors shown in the console, fyi

This question has accepted answers - jump to:

Answers

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    I added a sequence column, and added the below to the DataTables initiation:

    rowReorder: {
                selector: 'tr'
            },
            columnDefs: [
                { targets: 0, visible: false }
            ]
    

    Just to make sure it had the sequence column, to see if that would help, didnt

  • allanallan Posts: 63,747Questions: 1Answers: 10,509 Site admin

    Hi,

    Could you provide a link to the page so I can try to debug what is going wrong please?

    Thanks,
    Allan

  • fuchss65fuchss65 Posts: 1Questions: 0Answers: 0

    Even your own example at:
    https://datatables.net/extensions/colreorder/examples/integration/state_save.html
    does not work and gives Javascript error (in chrome).

  • allanallan Posts: 63,747Questions: 1Answers: 10,509 Site admin

    Hi fuchss65 - thanks for the link. This is a bug in DataTables unfortunately :-(. I committed a fix for this earlier today and will likely release an update reasonably soon.

    Regards,
    Allan

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75
    edited August 2015

    Theres no public version of this as of yet, its all local

    Uploading it to a server for now, ill message you a login. Should I PM you on here Allan or what?

  • allanallan Posts: 63,747Questions: 1Answers: 10,509 Site admin

    PM would be great. Click my name above and then "Send message".

    Allan

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Im getting my server setup with the right php version, then ill hit ya up with the URL/login

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75
    edited August 2015

    I got most of my issues fixed, just the last thing is the scroll issue... where if you drag a row to the bottom enough to make the screen scroll, and let it go as the screen is scrolling, the screen wont ever stop scrolling, lol

  • allanallan Posts: 63,747Questions: 1Answers: 10,509 Site admin

    the screen wont ever stop scrolling, lol

    Ouch!

    Fix committed here. The source is available in that repo with the fix. I'm doing some work on the nightly versions at the moment, so they aren't up to date with this change yet (likely won't be until the end of the week).

    Thanks for letting me know about this.

    And sorry about my slow response to your PM!

    Allan

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Dont worry about it man, I have this problem when messaging you... Ill find a problem, work on it for up to a few hours, then ill message you, and go back to the problem, and find a solution 30 seconds later, so ill msg you "nevermind". So its "Problem... nevermind, problem... nevermind, problem... nevermind"

    Wish I could delete messages ive sent to you from your inbox, I feel like the boy who cried wolf, lol

  • allanallan Posts: 63,747Questions: 1Answers: 10,509 Site admin
    Answer ✓

    Lol - Its often the only way to resolve a problem. Post for help and then immediately find the answer :-)

    Allan

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    @allan The scrolling issue, just an FYI, I noticed it happens on the AutoFill Scrolling Example too. Start to autofill columns and make the table scroll a little, if the popup happens while scrolling, it wont stop

  • allanallan Posts: 63,747Questions: 1Answers: 10,509 Site admin
    Answer ✓

    The examples are using 2.0.0 release rather than the nightly version, which I believe should address this issue. When 2.0.1 is released it should be resolved.

    Allan

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Ok cool, I just thought id let ya know. Its the same issue as when you re-order rows right?

  • allanallan Posts: 63,747Questions: 1Answers: 10,509 Site admin

    As far as I am aware, yes.

    Allan

This discussion has been closed.