I am using
gem 'jquery-datatables-rails', '3.4.0'
gem 'ajax-datatables-rails'
My CoffeeScript for this table looks like
# Datatables
$ ->
table = $('#qr-submissions-table').dataTable
dom: 'C<"clear">lfrtip'
processing: true
serverSide: true
ajax: $('#qr-submissions-table').data('source')
pagingType: 'full_numbers'
columns: [
{data: 'custom_columns'}
{data: 'delivery_number' }
{data: 'qpi_department' }
{data: 'qr_client' }
{data: 'date_submitted'}
{data: 'bay_number' }
{data: 'submitted_by'}
{data: 'delivery_note'}
{data: 'ops' }
]
"order": [[ 3, "desc" ]]
columnDefs: [
{ "orderable": false, "targets": [3, 7, 8]},
{"targets": 1, visible: ($("#delivery_number_show").val() == 'true')},
{"targets": 2, visible: ($("#division_show").val() == 'true')},
{"targets": 3, visible: ($("#client_show").val() == 'true')},
{"targets": 4, visible: ($("#scan_time_show").val() == 'true')},
{"targets": 5, visible: ($("#delivery_location_show").val() == 'true')}
{"targets": 6, visible: ($("#submitted_by_show").val() == 'true')},
{"targets": 7, visible: ($("#delivery_note_show").val() == 'true')},
{"targets": 8, visible: ($("#photo_show").val() == 'true')},
]
Here the custom column field is hash like '{ "name1" : "value1", "name2" : "value2" }'
.. How can i display this as coulm names and values. name1 and name2 will be column headers and value1 and value2 will be corresponding row values.each row has different values for 'value1' and 'value2'. Is there any way to do this? Please help?