The following is code snippet to update two cells of a single row using fnUpdate
function: (ref:Datatables)
var oTable = $('#depGridView').dataTable();
oTable.fnUpdate( 'First', 4, 1 );
oTable.fnUpdate( 'Last', 4, 2 );
The above code successfully update second and third column of fifth row (:index=4). To get the index value run time , I made the following changes
var oTable = $('#depGridView').dataTable();
var getIndex = document.getElementById("indexDepRow").value;
oTable.fnUpdate( 'First', getIndex , 1 );
oTable.fnUpdate( 'Last', getIndex , 2 );
but this does not working, it not update my row. To check that the variable getIndex storing correct index value, I use alert(getIndex) in script. It alert me 4 when I click on fifth row.
How can we overe this?
The following is code snippet to update two cells of a single row using fnUpdate
function: (ref:Datatables)
var oTable = $('#depGridView').dataTable();
oTable.fnUpdate( 'First', 4, 1 );
oTable.fnUpdate( 'Last', 4, 2 );
The above code successfully update second and third column of fifth row (:index=4). To get the index value run time , I made the following changes
var oTable = $('#depGridView').dataTable();
var getIndex = document.getElementById("indexDepRow").value;
oTable.fnUpdate( 'First', getIndex , 1 );
oTable.fnUpdate( 'Last', getIndex , 2 );
but this does not working, it not update my row. To check that the variable getIndex storing correct index value, I use alert(getIndex) in script. It alert me 4 when I click on fifth row.
How can we overe this?
Share Improve this question edited Oct 3, 2013 at 4:20 madth3 7,34412 gold badges52 silver badges74 bronze badges asked May 13, 2012 at 18:40 Both FMBoth FM 7701 gold badge14 silver badges33 bronze badges1 Answer
Reset to default 4use parseInt(getIndex)
instead of using row directly.
DEMO
Hope this helps