Linebreak in Column Cell using columns.data and columns.render
Linebreak in Column Cell using columns.data and columns.render
I'm not exactly sure if columns.data is necessary for this, but I see them paired together a lot.
I am processing AJAX data in my serverData call, and create an array to represent a row. However, not all of the columns match up to a column in the table. Meaning, I have fewer columns displayed on the table than in the array of row data. I would like to combine the data from multiple indices of the array and place the combination in one cell, with a linebreak.
Using this approach, we are able to keep the integrity of the raw data in the case that you would want to export the data to an excel spreadsheet or some other format of output.
I believe that accessing the contents of the array is pretty straightforward - just index into the row
parameter and extract the piece of data you want. However, I tried doing this and my datatable is now loading significantly less data. Also, where does columns.data come into play for this approach?