Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

Sort table not based on values in dataset

$
0
0

Good morning,

I am trying to sort a table, based on values, which are combined in one Column. For instance I have this render function for the column:

render: function (val, type, row) {
    return  row['date1'] + ' - ' + row['date2'];
}

Server side I have this:

Editor::inst( $db, 'table' )
    ->fields(
        Field::inst( 'date1'),
        Field::inst( 'date2'),
        Field::inst( 'description'),
        Field::inst( 'xyz' )
...

This is working, but now I would like to sort the table either by date1 oder by date2, which are both in on column.

Additionally, I would like to have those sort-options in a separate dropdown, so that sorting is not done by clicking on the the table head, but by selecting the desired value in a dropdown.

Thank you!

Ben


Viewing all articles
Browse latest Browse all 2364

Trending Articles