“Stop running this script” when using fnGetPosition
“Stop running this script” when using fnGetPosition
dkaganovich
Posts: 2Questions: 0Answers: 0
Hi,
When total number of records grows above 1000 and when I click on ALL (show all records) I begin to get “Stop running this script”. Caused by recursive call of fnGetPosition (var dataPosition = this.fnGetPosition(nRow)). I need position to be stored with the row so I can retrieve it later to use with fnGetData.
Is there a way to store position within the record at the time of creation?
I also, tried to retrieve position at the time of click (handleClickOnEditImage), but was not successful.
The snapshot of code is below. I am using IE8, and jquery.dataTables.js V: 1.8.1
that.displayTable = function () {
var oTable = $('#example').dataTable( {
"bJQueryUI": true,
"bAutoWidth":false,
"bProcessing":true,
"aaData": dpData.dataValues,
"sPaginationType": "full_numbers",
"aLengthMenu": [[13, 50, -1], ["Page", 50, "All"]] ,
"sScrollY": "331", //visible part of the table
"sScrollX": "100%",
"sScrollXInner": parseInt(dpData.dataProperties.length * 150),
"sDom": '<"H"C<"tableTitle"><"addButton">fr>t<"F"ilp>',
"bDeferRender": true,
"oColVis": {"activate": "click"},
"oLanguage": {"sSearch": "Filter:"},
"fnRowCallback": rowCallBack
} );
DP.currentTable = oTable;
return oTable;
};
var rowCallBack = function( nRow, aData, iDisplayIndex ) {
var dataPosition = this.fnGetPosition(nRow),
editImage = ' ';
$(nRow).find('td:first').find('.ellipsis').prepend(editImage).prepend(nRow);
return nRow;
};
var chosenRowData = DP.currentTable.fnGetData(parseInt(dataPosition));
When total number of records grows above 1000 and when I click on ALL (show all records) I begin to get “Stop running this script”. Caused by recursive call of fnGetPosition (var dataPosition = this.fnGetPosition(nRow)). I need position to be stored with the row so I can retrieve it later to use with fnGetData.
Is there a way to store position within the record at the time of creation?
I also, tried to retrieve position at the time of click (handleClickOnEditImage), but was not successful.
The snapshot of code is below. I am using IE8, and jquery.dataTables.js V: 1.8.1
that.displayTable = function () {
var oTable = $('#example').dataTable( {
"bJQueryUI": true,
"bAutoWidth":false,
"bProcessing":true,
"aaData": dpData.dataValues,
"sPaginationType": "full_numbers",
"aLengthMenu": [[13, 50, -1], ["Page", 50, "All"]] ,
"sScrollY": "331", //visible part of the table
"sScrollX": "100%",
"sScrollXInner": parseInt(dpData.dataProperties.length * 150),
"sDom": '<"H"C<"tableTitle"><"addButton">fr>t<"F"ilp>',
"bDeferRender": true,
"oColVis": {"activate": "click"},
"oLanguage": {"sSearch": "Filter:"},
"fnRowCallback": rowCallBack
} );
DP.currentTable = oTable;
return oTable;
};
var rowCallBack = function( nRow, aData, iDisplayIndex ) {
var dataPosition = this.fnGetPosition(nRow),
editImage = ' ';
$(nRow).find('td:first').find('.ellipsis').prepend(editImage).prepend(nRow);
return nRow;
};
var chosenRowData = DP.currentTable.fnGetData(parseInt(dataPosition));
This discussion has been closed.
Replies
Try 1.9+. fnGetPosition is massively faster in the new versions.
Allan
How many rows are being shown?
Allan