Get the field (hash keys) used to get data for a column

Get the field (hash keys) used to get data for a column

traffictraffic Posts: 3Questions: 2Answers: 0

I have run into a problem due to a working with legacy data and I really do not want to redo the DataTables support. I have several tables with column "titles" and populate the row from a hash using a hash key. The hash keys are not the same as the title: { "data": "when", "title": "Start Time" }

I want to get a list/array of the "data" values, i.e. - the hash keys used to populate the row vakues from the data hash: [ "when", "lp", "name", .... ]. I need this so that I can generate a JSON object with all of
the fields shown in the table. Now i KNOW that I can get the underlying data hash object
BUT it has additional fields in it I do not want to export. I just KNOW that there is a simple
way to do this... at the DataTables/Javascript level

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Hi @traffic ,

    I didn't get what you meant about the additional fields you don't want in the export, but does something like this do the trick?

    Cheers,

    Colin

This discussion has been closed.