Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

  • I am trying to change data of a selected row. In my case when a row is clicked it returns the index of that row and then i am trying to update that row with the index of the row i clicked. I can get the index properly, but when i try to update the row it gives an error "Requested unknown parameter 'id' for row 0,column 0".

  • In this case the index that i am trying to update is 0. Here is my code

    var newdata=['data','data2','data2','data4'];

    table.row(0).data(newdata).draw()


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
272 views
Welcome To Ask or Share your Answers For Others

1 Answer

This may help you!

var dtable= $('#example').DataTable();
rowId = 0 ; //first row
newData = [ "column1 data", "column2 data", "column3 data" ] //Array, data here must match structure of table data
dtable.row(rowId).data( newData ).draw();

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...