colVis plugin new init with options parameter

colVis plugin new init with options parameter

h312m4oneh312m4one Posts: 2Questions: 1Answers: 0
edited November 2014 in Free community support

Hii. How can set option parameter with new init method?

for exmple:

$(document).ready( function () {
var table = $('#example').dataTable( {
"oColVis": {
"buttonText": "Change columns"
}
} );
var colvis = new $.fn.dataTable.ColVis( table );

$('#colVis').html(colvis.button());

} );

I try with this way. its not working.

Answers

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    Pass it in as the second parameter to the $.fn.dataTable.ColVis constructor.

    Allan

  • h312m4oneh312m4one Posts: 2Questions: 1Answers: 0

    Work perfect like this!!

    var colvis = new $.fn.dataTable.ColVis( table, { "buttonText": "Change columns" });

    Thanks...

This discussion has been closed.