Server side processing with row grouping, paging issue

Server side processing with row grouping, paging issue

xfloydxfloyd Posts: 35Questions: 12Answers: 1
edited April 2012 in General
Server side with row grouping, paging issue

I’m trying to implement row grouping with server side processing and I’m running into paging problem, all works great until one tries to go to another page, it works for one page and then DataTables stops working, I’m sure it’s related to the fact that I’m using an example that uses grouping without server side. Unfortunately this is beyond my knowledge. If anyone would give me some pointers on how to make that work that would be great. BTW awesome plugin and a huge time saver when it comes to data/table processing. Here is code I’m using.

Thanks
[code]
$(document).ready(function() {
$('#example').dataTable( {
"aLengthMenu": [[10, 25, 50, 100, 500, 5000], [10, 25, 50, 100, 500, 5000]],
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "server_processing2.php",
//grouping option
"fnDrawCallback": function ( oSettings ) {
if ( oSettings.aiDisplay.length == 0 )
{
return;
}

var nTrs = $('#example tbody tr');
var iColspan = nTrs[0].getElementsByTagName('td').length;
var sLastGroup = "";
for ( var i=0 ; i

Replies

  • xfloydxfloyd Posts: 35Questions: 12Answers: 1
    edited April 2012
    Firebug, shows this JavaScript error once paging is clicked

    oSettings.aoData[oSettings.aiDisplay[iDisplayIndex]] is undefined
    var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[0];

    Which point to line # 22 in the code I pasted above. Not that I know what the probem is but maybe someone knows.
  • xfloydxfloyd Posts: 35Questions: 12Answers: 1
    I guess I should try harder next time, found answer on this forum http://datatables.net/forums/discussion/907/strange-firebug-alert-ff-after-change-pagination-in-row-grouping/p1
    Using “i” instead “iDisplayIndex” fixed the problem.
    Thanks for making me think :)
This discussion has been closed.