ColReorder icon indicating copy to clipboard operation
ColReorder copied to clipboard

Resetting table does not reset ColReorder

Open Rello opened this issue 1 year ago • 2 comments

Hello,

thank you for providing ColReorder!

  1. I initialize a table with a reorder OCA.Analytics.tableObject = new DataTable(domTarget, { colReorder: { order: [0, 2, 1, 5, 6, 4, 3]} })
  2. I destroy the table OCA.Analytics.tableObject.destroy();
  3. I initialize a table without a given order OCA.Analytics.tableObject = new DataTable(domTarget, { colReorder: true })
  4. The table columns are off
  • Adding a OCA.Analytics.tableObject.colReorder.reset() before the destroy does not make a difference. something seems to be kept in memory somewhere?
  • doing a draw() after the table is displayed will correct the display, but this is not intended
  • doing a full refresh into the second table, it is shown correctly

reordered table: Bildschirmfoto 2024-04-09 um 10 47 52

normal table after coming from the reordered one: Bildschirmfoto 2024-04-09 um 10 49 31

Rello avatar Apr 09 '24 09:04 Rello

I want to add some additional finding for documentation purposes.

I use the parameter scrollX: true. if this is removed, the tables is generated correctly with colReorder: true

but why does it work with a completely clean table, but not with a redrawn, once it was colReordered before?

Rello avatar Apr 09 '24 09:04 Rello

Could you create a test case demonstrating the issue please? I've just tried to do so here: https://live.datatables.net/hudumofu/1/edit but it appears to work as expected.

AllanJard avatar Apr 11 '24 10:04 AllanJard