Replacing cell value before table draw if pair is found in array

Replacing cell value before table draw if pair is found in array

KarfieldKarfield Posts: 8Questions: 2Answers: 0

Hi,

I am drawing a table from user selected CSV file that is parsed as JSON array. I need to reorder, concatenate and replace some of the data before drawing the final product as a table.

So far I have successfully used ColReorder to reorder the data and I think concat should be easy.

Checking the cell data in certains columns of DataTables and replacing them with value pair from an array is turning out to be a bigger problem than I thought.

What I am trying to achieve:

Imported CSV Column:
4001
4001
5001
5001

Conversion Chart:
4001 -> 8001
5001 -> 9001

DataTables Column:
8001
8001
9001
9001

Thanks in advance!

Answers

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin

    How are you currently trying to do it? The cells().every() method (or rows().every() depending on how you want to do the iteration) would probably be my starting point.

    Allan

This discussion has been closed.