Problem with installing colReorder extension

Problem with installing colReorder extension

DavidHarkerDavidHarker Posts: 11Questions: 2Answers: 0

Hi

I'm trying to install and add the colReorder extension for my datatables but I'm running into a few issues. the first issue I'm getting is after I've installed all of the necessary files. when I go to replace the order of the columns i get this error below:

dataTables.colReorder.js:1067 Uncaught TypeError: this.s.dt.oInstance.fnColReorder is not a function at ColReorder._fnMouseUp (dataTables.colReorder.js:1067) at HTMLDocument.<anonymous> (dataTables.colReorder.js:969) at HTMLDocument.dispatch (jquery.js:5183) at HTMLDocument.elemData.handle (jquery.js:4991)

A solution I've found that allows me to use the extension is by switching the placement of where its required. However, this then causes an issue with the datatables-select extension. So if i changed the order from:
require('datatables.net-colreorder'); require('datatables.net-select');

To:

require('datatables.net-select'); require('datatables.net-colreorder');

I'm able to reorder the columns. But i then get this new error with the select extension :
Uncaught TypeError: model.MainTable.rows(...).deselect is not a function at dataSrc (MainTableSetup.js:35) at jquery.dataTables.js:2606 at _fnAjaxDataSrc (jquery.dataTables.js:4164) at _fnAjaxUpdateDraw (jquery.dataTables.js:4109) at jquery.dataTables.js:3972 at callback (jquery.dataTables.js:3864) at Object.success (jquery.dataTables.js:3894) at fire (jquery.js:3268) at Object.fireWith [as resolveWith] (jquery.js:3398) at done (jquery.js:9305)

I've added all of the latest extensions, but I'm not sure why these two extensions are interfering with each other.

Thanks.

Answers

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi DavidHarker,

    Thanks for your question. As noted in the forum rules, please post a link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Thanks,

    Sandy

This discussion has been closed.