ColReorder does'nt work
ColReorder does'nt work
sabrick
Posts: 10Questions: 4Answers: 0
ColReorder.fnReset(oTable) doesn't work. It should be reordering all the columns back to what they were originally
The ColReorder object doesn't even exist even though I have imported the colReorder.js file.
I have used this before in a previous project and I'm using this exact code:
ColReorder.fnReset(oTable)
and it works fine, but in this project no luck.
Any suggestions?
This discussion has been closed.
Answers
$('._reportTable').dataTable().colReorder.reset()
doesn't work either, the colReorder object doesn't exist.
I'm using 1.9.4 btw
What version of ColReorder are you using?
@Rpiechura: 1.1.1
I've even taken every other mod out and did this:
colReorder: { order: [1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10] }
And it's STILL ignoring the column order. I can even put as many numbers as I like in there it doesn't even read it!
Silly question, but you made sure that in your initialization code that you're doing something like
right? Because if you're not than you're not telling the datatable to use the reorder plugin.
So after messing around with it the past half hour, it appears that something change from 1.0.8 to 1.1.0 (let alone 1.1.1) which makes you have to do things differently. The project you were using it probably had 1.0.8 which is why it worked. I'm gonna see if I can't figure out how you're supposed to do it now, however if you were to go back to using that version things should work just fine for you.
http://datatables.net/extensions/colreorder/api, the code you're looking for is...
That will set up the order, to call it you want to do...