fnColReorderCallback is not called
fnColReorderCallback is not called
Azzu
Posts: 8Questions: 0Answers: 0
(First, sorry for my English if it's bad, I'm French ^_^)
Hi, the fnColReorderCallback is not called when a column has been moved.
I'm using :
jquery-1.8.3
Datatables 1.9.4
ColReorder 1.0.8
And others plugins/extras :
FixedHeader 2.0.6
ColVis 1.0.8
TableTools 2.1.4
ZeroClipboard 1.0.4
I tried with all the nightly releases, no difference.
However with a modified release of the 1.0.3, it works (without touching the following code).
[code]var oTable = $('#example').dataTable( {
"oColReorder": {
"aiOrder": colOrder,
"fnColReorderCallback": function() {
alert("fnColReorderCallback");
}
});[/code]
Has anyone the same issue or I should double check my code again ?
Hi, the fnColReorderCallback is not called when a column has been moved.
I'm using :
jquery-1.8.3
Datatables 1.9.4
ColReorder 1.0.8
And others plugins/extras :
FixedHeader 2.0.6
ColVis 1.0.8
TableTools 2.1.4
ZeroClipboard 1.0.4
I tried with all the nightly releases, no difference.
However with a modified release of the 1.0.3, it works (without touching the following code).
[code]var oTable = $('#example').dataTable( {
"oColReorder": {
"aiOrder": colOrder,
"fnColReorderCallback": function() {
alert("fnColReorderCallback");
}
});[/code]
Has anyone the same issue or I should double check my code again ?
This discussion has been closed.
Replies
There is an event called `column-reorder` which you could listen for - that will basically do the same thing.
Allan
I found the callback function here : http://datatables.net/extras/colreorder/api,
but it is no impossible that i misunderstood something.
However the event "column-reorder" doesn't seem to work.... Am I using it right ?
[code]var oTable = $('#example').dataTable( {
"oColReorder": {"column-reorder": function() {
alert("hi");
}
});[/code]
Let me look into it and get back to you shortly.
Allan
1. The callback option is `fnReorderCallback` - not fnColReorderCallback.
2. You weren't actually initialising ColReorder there, as there is no `R` option in sDom.
This is what you what your initialisation to look like:
[code]
var oTable = $('#example').dataTable( {
"sDom": 'Rlfrtip',
"oColReorder": {
"aiOrder": colOrder,
"fnReorderCallback": function() {
alert("fnReorderCallback");
}
}
} );
[/code]
I've updated the documentation to put the callback into the initialisation options, where it should be :-).
Regards,
Allan
I wasn't using the good name ! "fnColReorderCallBack" was the name in my old release (ColReorderWithResize 1.0.3) and I didn't notice the difference...