Host multiple properties in one column

Host multiple properties in one column

octavoctav Posts: 18Questions: 0Answers: 0
edited September 2013 in General
Hi there, Mr Allan,
I have a table with a lot of columns and I need to save up space. The way it is implemented is having multiple properties in one column, in an Html table that is pre-rendered before applying datatables plugin to it. But now we need to implement AJAX functionality to support large data quantities, and as such we cannot use the pre-rendered Html table. I read a post about using objects when sending JSON to datatables object. Is there a way this could be achieved ?

Replies

  • miwoemiwoe Posts: 14Questions: 2Answers: 0
    Hi,

    when you read the data from the JSON source, you define each column with the mData-property like this

    [code]dataTableObject.aoColumns = [{"mData": function ( source, type, val ) {...}}][/code]

    Inside the function block you can return any html for the column and point to any JSON property in the source object. In the bottom example, I m creating a link in a column which is invoking a function with parameters (id, start, ende), coming from the original JSON object.

    [code]return "".....[/code]
This discussion has been closed.