fnFakeRowspan - normal mode (without server-side processing)

fnFakeRowspan - normal mode (without server-side processing)

mmmgggmmmggg Posts: 5Questions: 0Answers: 0
edited October 2013 in Plug-ins
Hi,

I am trying to use the fnFakeRowspan plugin but without the server-side processing feature of the DataTables.
My scenario si the following:

1. Manually trigger the ajax call to get the data

[code]
$.ajax({
"dataType": 'json',
"type": "GET",
"url": "../api/appointments",
"data": "i=" + ids,
"success": appDataReady
});
[/code]

2. When data is received, make some modifications, hook some event handlers depending on data
[code]

//column I wish to merge cells on
// there are 2 hidden cells (index 0 and 1) hidden by the code below
// I need to merge cells on the column index 2, which is is actually the first visible column (but the 3rd column in the data)
var iColumn = 2;


function appDataReady(data)
{
// client side processing/altering of the received json data like:
if (data.aoColumnDefs[i].sName == 'time_limit')
{
data.aoColumnDefs[i].mRender = function (data, type, full) { ... some code here ... }
}

// hide some columns
// this might raise some problems on drawCallback
// since oSettings.aoData._aData[iColumn] and oSettings.aoData.nTr.childNodes[iColumn] are out of sync, correct?
data.aoColumnDefs[i].bVisible = false;

// initialize datatables
var dt = $("#tblApp").dataTable(data);
}
[/code]

3. After all data is ready, I need to merge some cells containing same text and I am trying to do it like this:
[code]
dt.fnFakeRowspan(iColumn, false);
[/code]

Nothing happens and I can see in the console that the "fakeRowspan" function never gets called even if the aoDrawCallback contains the entry.

What would be the solution to my scneario?

Thank you.
This discussion has been closed.