0

I am using DataTables and the TableTools add-on. I want to use TableTools with a blank column to export a pdf version of the table. Using fnRender

$('#example').dataTable({ 
  'mDataProp':null, 
  'sTitle':'Date',
  'fnRender':function (oObj) {
       return oObj.aData.date.substring(0, 10);
   }
});

without fnRender , TableTools works well (of course)

sugestões?

Binary Alchemist
  • 1,600
  • 1
  • 13
  • 28
Bruno Light
  • 13
  • 1
  • 7

2 Answers2

3

fnRender is slated to be removed in the next release , and the documents suggest using mRender.

Binary Alchemist
  • 1,600
  • 1
  • 13
  • 28
1

yes fnRender is no more available in the jquery datatable, Replace fnRender with mRnder please also check index of date field by debugg as well, I am going to set oObj.aData[0], but it may be 1,2 etc.

    $('#example').dataTable({ 
    'mDataProp':null, 
    'sTitle':'Date',
    'mRender':function (data, type,oObj) {
        return oObj[0].substring(0, 10);
    }
    });
Mukesh Salaria
  • 3,345
  • 1
  • 16
  • 21