update row is removing client functions
update row is removing client functions
Hello,
I am using the following code to update a row which also has some html controls(update,delete). The data in the table gets updated but the buttons that are re-drawn are losing their click events and so I cannot update or delete this row the second time. Any reason why and how can I fix it?
var myTable = $('#details-data-table').DataTable();
var curGridRowNum = parseInt($('#hfRowNumber').val());
var currRow = myTable.row(curGridRowNum);
var currRowData = currRow.data();
//update some columns
currRowData[1] = k1.Linetype;
currRowData[2] = k1.Itemnumber;
currRowData[3] = k1.Itemdescription;
currRowData[4] = k1.Itemquantity;
currRowData[5] = k1.Itemtime;
currRowData[6] = k1.Itemprice;
myTable.row(curGridRowNum).data(currRowData).draw();
This question has an accepted answers - jump to answer
Answers
You probably need to use jQuery delegated events. This example may help:
http://live.datatables.net/xijecupo/1/edit
Kevin
That worked thanks!
$('#details-data-table tbody').on('click', '.clsButtonEdit', function ()
{