DataTables warning (table id = 'example'): Requested unknown parameter 'projectid' from the data
DataTables warning (table id = 'example'): Requested unknown parameter 'projectid' from the data
Hello
I have a DataTable with an Edit and Save column like from example here.
All works fine if you click on Edit then ediot the columns and then click on Save.
But if you click for example on the first row on Edit and then go to second row and click also on Edit then I receive the error
"DataTables warning (table id = 'example'): Requested unknown parameter 'projectid' from the data source for row 0"
Then the column 0 and 1 dissappears.
The problem must be somewhere in the if area here or in Function restoreRow?
var nEditing = null;
$('#example').on('click', 'a.edit', function (e) {
e.preventDefault();
/* Get the row as a parent of the link that was clicked on */
var nRow = $(this).parents('tr')[0];
// alert('die row ist:' + nRow );
if ( nEditing !== null && nEditing != nRow ) {
/* A different row is being edited - the edit should be cancelled and this row edited */
alert('if');
restoreRow( oTable, nEditing );
editRow( oTable, nRow );
nEditing = nRow;
}
else if ( nEditing == nRow && this.innerHTML == "Save" ) {
/* This row is being edited and should be saved */
//alert('else if');
saveRow( oTable, nEditing );
nEditing = null;
}
else {
/* No row currently being edited */
alert('else');
editRow( oTable, nRow );
nEditing = nRow;
}
} );
This is the function restoreRow:
function restoreRow ( oTable, nRow )
{
var aData = oTable.fnGetData(nRow);
var jqTds = $('>td', nRow);
for ( var i=0, iLen=jqTds.length ; i<iLen ; i++ ) {
oTable.fnUpdate( aData[i], nRow, i, false );
}
oTable.fnDraw();
}
The first column of the datatable is the projectid
I have no idea what I can do
thanks for any help
kind regards
Hans
Answers
Can somebody please help me or give me an hint how to debug?