Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoid sort on last row in the table DataTable plugin

var oTable = $('#table').dataTable({
                "sScrollX": "100%",
                "sScrollXInner": "150%",
                "bScrollCollapse": true,
                "bPaginate": false,
                "bFilter": false,
                "bSortable": true          
            });
            new FixedColumns(oTable, {
                "iLeftColumns": 1,
                "iRightColumns": 1
            });

I am using data table plugin, And my initialize code is as above, i want my last row not column not to be sorted, when i click on any header. I searched every where I couldn't find a way to stop row sorting...Please help me out..............

like image 274
user2486535 Avatar asked Dec 05 '13 07:12

user2486535


2 Answers

The HTML needs to have a specific setup with thead and tbody tags. So theoretically I could put my last row into a tfoot tag and it wouldn't be affected by sorting.

hope this will work for you.

http://blog.adrianlawley.com/tablesorter-jquery-how-to-exclude-rows/

like image 103
Rishi Jagati Avatar answered Sep 17 '22 22:09

Rishi Jagati


Add Footer To The Table .... It Wont Sort The Last Column

<tfoot>
   <tr>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td><b>TOTAL</b></td>
      <td id="billedAmount"></td>
      <td id="totalOtherCharges"></td>
      <td id="totalCost"></td>
   </tr>
</tfoot>
like image 23
Sheik Sena Reddy Avatar answered Sep 17 '22 22:09

Sheik Sena Reddy