colReorder - error "... has no method _fnConstruct"

colReorder - error "... has no method _fnConstruct"

ZytaZyta Posts: 2Questions: 0Answers: 0
edited February 2014 in DataTables 1.9
Hi all,

I'm working on a project with datatable + colVis + colReorder.

I initialize my datatable like that :

[code]
this.dttt = this.dt.dataTable({
"sDom": "<'row-fluid datatable-tools'<'span6'l T r><'span6'f>>R<'dt-wrapper't><'row-fluid clearfix'<'span12'p i>>",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": scope.dt.attr('data-src'), // return URL
"oColReorder": scope.setColReorderOptions() // return array like [1, 2, 3]
});
[/code]

and I try to get cols order directly after databtable initialisation like the example in documentation :

[code]
$.fn.dataTable.ColReorder(this.dttt).fnGetCurrentOrder();
[/code]

And I always have an error : "$.fn.dataTable.ColReorder has no method _fnConstruct"

Same error with basic implementation : http://jsfiddle.net/5jj99/1/

May be I don't do it in the right way, but if someone can help me ^^

Thx for your attention !

Replies

  • allanallan Posts: 63,679Questions: 1Answers: 10,498 Site admin
    You need to create a `new` ColReorder instance - i.e. `new $.fn.dataTable.ColReorder()` : http://jsfiddle.net/5jj99/2/

    Allan
  • ZytaZyta Posts: 2Questions: 0Answers: 0
    Erf, obvious :x Thank you very much :)
This discussion has been closed.