Display number of records in a page And oTableTools property together

Display number of records in a page And oTableTools property together

vamvam Posts: 5Questions: 0Answers: 0
edited February 2014 in Bug reports
Hi,

I want to select drop-down for no of record per page and export option in same page.

but am unable to do it both together.

either one of them option work at a time.

My table configuration as given below

[code]
tableObj= [];
tableObj.aaData = data.msg.aaData;
tableObj.aoColumns = aoColumns;
tableObj.bProcessing = true;
tableObj.sScrollX = "100%";
tableObj.bDestroy = true;
tableObj.bStateSave = true;
tableObj.sDom = '<"H"Tfr>t<"F"ip>';
tableObj.oTableTools = [];
tableObj.oTableTools.aButtons = ["copy", "csv", "xls", "print"];
tableObj.oTableTools.sSwfPath = "/js/copy_csv_xls.swf";
tableObj.bLengthChange = true;
tableObj.aLengthMenu = [[10, 25, 50, -1], [10, 25, 50, "All"]];
tableObj.iDisplayLength = 10;
tableObj.fnStateLoad = function (oSettings) {
return false;
};
$('#biReportTable').dataTable(tableObj);
[/code]

Kindly help me to resolve the same.
Thanks in advance

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    A very unusual way of doing it, but it should work. I would suggest you change `tableObj= [];` to `tableObj= {};` since you want to pass in an object.

    However, I think the problem you are having here is the your sDom doesn't have the length menu option in it (i.e. `l` ). Just add the letter `l` into your sDom, where you want it to appear in the DOM structure, and it will be there.

    Allan
  • vamvam Posts: 5Questions: 0Answers: 0
    Hi Allan,

    Thanks Its working.

    I had change Sdom property to Tlfrtip and its start working.

    Thanks once again.
This discussion has been closed.