Copying data from one column to another

Copying data from one column to another

ramapramap Posts: 4Questions: 1Answers: 0
edited May 2013 in General
I have a table of data (with 20 columns) that I am displaying using dataTables. I also have an assignment button (id=assign). What I am trying to do is copy the data in column#14 to column#20 when i click the button. I might do this on all the rows or a selection of them. my code looks like this.

[code]
$(document).ready(function() {
var oTable = $('#myTable').dataTable();

$('#assign').click(function() {
var selectedRecords = oTable.fnSettings().aiDisplay; //gives an array of row indices
for(i=0;i

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Its doing a redraw on your fnUpdate which might be causing the problem. Add `false` as the fourth and fifth parameters for fnUpdate and then add a call to fnDraw after the loop. That might do it.

    Allan
  • ramapramap Posts: 4Questions: 1Answers: 0
    thanks Allan, that did the trick :)
This discussion has been closed.