Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81666

Multiple Tables cause this[DataTable.ext.iApiIndex] to be undefined

$
0
0
Hi All,

I've got a very simmilar problem like:
http://datatables.net/forums/discussion/4384/how-do-i-make-api-calls-when-using-multiple-tables/p1

I'm trying to get the selected rows from my table, which works quite nice as long I have only the first table rendered.
The second table appears in a dialog in front of the other.

I found out that the function fnGetData() fails because this[DataTable.ext.iApiIndex] returns undefined.
this.fnGetData = function( mRow, iCol )
		{
			var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );

Then I found the discussion above.
So, I added to my code:
    $.fn.dataTableExt.iApiIndex = 1;

Now I am wondering why it isn't changing anything.

Mycode:
function fnGetSelected(oTableLocal) {
    return $(oTableLocal.selector + ' tr.row_selected');
}

function fnGetSelectedRowIDs(oTableLocal) {
    oTableLocal.dataTable();

    var paramsArray = new Array();
    $.fn.dataTableExt.iApiIndex = 1;
    
    $.each(fnGetSelected(oTableLocal), function (index, item) {
        var rowValues = oTableLocal.fnGetData(item);
        paramsArray.push({ Id: rowValues[0], Uid: rowValues[1], RowVersion: rowValues[2] });
    });

    return { ids: idsArr, uids: uidsArr, rowversions: rowvArr, paramsArray: paramsArray };
}

I'm sorry, I can't make the page accessible to external users.

I've uploaded a debug dump at:
http://debug.datatables.net/esovor
Hope this helps.

Are there known issues from loading a dataTable into a JQuery dialog?

Is there any way to resolve this problem?

BTW:
Thank you, for your time and this really nice piece of software.

Viewing all articles
Browse latest Browse all 81666

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>