ColReorder : fnGetOrder

ColReorder : fnGetOrder

AzzuAzzu Posts: 8Questions: 0Answers: 0
edited January 2013 in General
I just created the fnGetOrder method based on chentao1006's work (see the link below) to get the current order of the columns (based on the initial order) for the plugin ColReorder.
It returns an array of int. It can be useful for personnal state saving ;)

[code]
ColReorder.prototype = {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Public methods
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
//...
"fnGetOrder": function()
{
var initOrder= [];
for(var i = 0, iLen=this.s.dt.aoColumns.length; i < iLen; i++ ) {
initOrder[i] = this.s.dt.aoColumns[i]._ColReorder_iOrigCol;
}
return initOrder;
},
//....

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Static functions
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
//...
ColReorder.fnSetOrder = function ( oTable, a )
{
for ( var i=0, iLen=ColReorder.aoInstances.length ; i

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Something odd has happened to my versioning - there is a method called fnGetCurrentOrder in git - https://github.com/DataTables/ColReorder/blob/master/media/js/ColReorder.js#L440 . This hasn't made it to a release yet.

    Allan
This discussion has been closed.