fnGetTableData function doesn't get all data that i insert after drawCallBack() !

fnGetTableData function doesn't get all data that i insert after drawCallBack() !

erykoseerykose Posts: 2Questions: 0Answers: 0

I grouped my row with the codes in datatable example (https://datatables.net/examples/advanced_init/row_grouping.html) then i initilized TableTools and when i try to export my table to xls or csv that use fnGetTableData function, It doesnt show and export my group name row and just save without any groupname. How can i export my table after i add some row like group rowing example ?

Replies

  • allanallan Posts: 61,635Questions: 1Answers: 10,092 Site admin

    See the append FAQ.

    In short, you need to use the API if you want to add data TableTools will see.

    Allan

  • erykoseerykose Posts: 2Questions: 0Answers: 0
    edited May 2014
            "drawCallback": function ( settings ) {
                var api = this.api();
                var rows = api.rows( {page:'current'} ).nodes();
                var last=null;
     
                api.column(2, {page:'current'} ).data().each( function ( group, i ) {
                    if ( last !== group ) {
                        $(rows).eq( i ).before(
                            '<tr class="group"><td colspan="5">'+group+'</td></tr>'
                        );
     
                        last = group;
                    }
                } );
            }

    in this codes for the lines :

                        $(rows).eq( i ).before(
                            '<tr class="group"><td colspan="5">'+group+'</td></tr>'
                        );

    how can i do this with api.row.add() ?

This discussion has been closed.