Rendering a custom row

Rendering a custom row

picktracepicktrace Posts: 12Questions: 5Answers: 0

I have a lot of data that needs to be shown in a single table, however this data is better viewed as progressbars/sliders, would the best way to render this into datatables be something like this?

    createdRow: function( row, data, dataIndex ) {
      $(row).html('<td colspan=20><--! all the stuff in the row here --></td>')
    }

Assuming I had 20 columns, or is there a better way to fully render a custom row?

Thank you!

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    DataTables and its extensions don't support custom rendered rows at the moment. You probably could get away with doing that in the simple case, but you would run into problems as soon as you tried to use Responsive, column visibility or a number of other features (it isn't something I've tested since it isn't supported, so I don't have a definitive list).

    Sorry!

    Allan

  • miwoemiwoe Posts: 14Questions: 2Answers: 0

    We had similar problem here. Our approach was to use the details row feature and put the additional content in that details row. The details row is containing partially big content. Forms, Images...

    We are using this approach in different tables. In some, the additional content is asynch-loaded and in other cases, the content is directly attached to the "data" of the datatable (where the overhead is not that big).

This discussion has been closed.