How to get data from two different columns and merge together with rows of each?

How to get data from two different columns and merge together with rows of each?

summit1234summit1234 Posts: 2Questions: 1Answers: 0

How do I get data from two different columns and merge them together but not by concatenating them. I was thinking that they would have rows of each. Can this be done with just a function in datatables?

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    I was thinking that they would have rows of each.

    If I understand correctly, you want to take one row, and create a second row from that. If so, the best place would be when the table has initialised, see initComplete, then scan all the rows with rows().every(), and create the new rows with row.add() (or rows.add() if you batch them up).

    Colin

  • summit1234summit1234 Posts: 2Questions: 1Answers: 0

    This will then get the values of the two columns and put them in another column (combined values of the two columns) where each value will be in a single cell?

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    I think we're confusing ourselves here. Can you restate what you're after please, with examples, so it's clearer.

    Colin

This discussion has been closed.