Use TableTools in Configurable Reports at moodle.

Use TableTools in Configurable Reports at moodle.

lexnuneslexnunes Posts: 1Questions: 1Answers: 0

I'm trying use tabletools in ConfigurableReports at moodle, but I can't.

This is the original function:

function cr_add_jsdatatables($cssid){
    global $DB, $CFG, $OUTPUT;

    echo html_writer::script(false, new moodle_url('/blocks/configurable_reports/js/datatables/media/js/jquery.js'));
    echo html_writer::script(false, new moodle_url('/blocks/configurable_reports/js/datatables/media/js/jquery.dataTables.min.js'));
    echo html_writer::script(false, new moodle_url('/blocks/configurable_reports/js/datatables/extras/FixedHeader/js/FixedHeader.js'));

    $script = "$(document).ready(function() {
        var oTable = $('$cssid').dataTable({
            'bAutoWidth': false,
            'sPaginationType': 'full_numbers',
      'bTableTools' : true,

// 'sScrollX': '100%',
// 'sScrollXInner': '110%',
// 'bScrollCollapse': true
});
new FixedHeader( oTable );
} );";
echo html_writer::script($script);
}

Here its mine:

function cr_add_jsdatatables($cssid){
    global $DB, $CFG, $OUTPUT;

    echo html_writer::script(false, new moodle_url('/blocks/configurable_reports/js/datatables/media/js/jquery.js'));
    echo html_writer::script(false, new moodle_url('/blocks/configurable_reports/js/datatables/media/js/jquery.dataTables.min.js'));
    echo html_writer::script(false, new moodle_url('/blocks/configurable_reports/js/datatables/extras/FixedHeader/js/FixedHeader.js'));
    echo html_writer::script(false, new moodle_url('/blocks/configurable_reports/js/datatables/media/js/dataTables.tableTools.js'));

    $script = "$(document).ready(function() {
        var oTable = $('$cssid').dataTable({
            'bAutoWidth': false,
            'sPaginationType': 'full_numbers',
      'dom': 'T<"clear">lfrtip',
        'tableTools': {       
             'sSwfPath': 'new moodle_url('/blocks/configurable_reports/js/datatables/extras/TableTools/media/swf/copyd_csv_xls.swf')'
        }

// 'sScrollX': '100%',
// 'sScrollXInner': '110%',
// 'bScrollCollapse': true
});
new FixedHeader( oTable );
} );";
echo html_writer::script($script);
}

What's wrong?

thx

This discussion has been closed.