Link to test case:
https://github.com/DataTables/ColReorder/issues/49
Current versions of packages installed:
"datatables.net-dt": "^1.11.3",
"datatables.net-colreorder-bs4": "^1.5.5",
Description of problem:
In reorder of columns using ColReorder, it was unable to trigger the dynamic insertion of components done in createdCell callback due to render being run.
Hence, the workaround I found was to trigger the same createdCell callbackfn in the return of renderFn.
I have raised a PR for the same https://github.com/DataTables/DataTablesSrc/pull/198
The usage sample is as below
col.renderReturnType = 'function'; // only then will these changes be activated
const createdCellCallback = (tdElm, cellData, rowData, rowIndex) => {
// dynamically insert an angular component into tdElm with help of Renderer2; passing in needed values from rowData and cellData as @Inputs to the component
}
col.render = (data, type, row, meta) => { return createdCellCallback; }
col.createdCell = createCellCallback;
Please check and merge this at the earliest, in a matter of hours to be exact.