New RowReorder Extension seems to mess with the table
New RowReorder Extension seems to mess with the table
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
I added a sequence column, and added the below to the DataTables initiation:
Just to make sure it had the sequence column, to see if that would help, didnt
Hi,
Could you provide a link to the page so I can try to debug what is going wrong please?
Thanks,
Allan
Even your own example at:
https://datatables.net/extensions/colreorder/examples/integration/state_save.html
does not work and gives Javascript error (in chrome).
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
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?
PM would be great. Click my name above and then "Send message".
Allan
Im getting my server setup with the right php version, then ill hit ya up with the URL/login
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
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
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
Lol - Its often the only way to resolve a problem. Post for help and then immediately find the answer :-)
Allan
@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
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
Ok cool, I just thought id let ya know. Its the same issue as when you re-order rows right?
As far as I am aware, yes.
Allan