Change Row Data With Javascript

Change Row Data With Javascript

MightyCodderMightyCodder Posts: 3Questions: 0Answers: 0
edited October 2012 in General
I am looking to be able to often change row data with JavaScript depending on results supplied by a socket connection.

I was just wondering what the best way to do this without compromising too much performance.

Should I delete the whole table, then repopulate it with the newly supplied array?

Replies

  • MisiuMisiu Posts: 68Questions: 4Answers: 2
    use [code]fnUpdate[/code] this way You'll change row data or specific cell.

    [code]
    $(document).ready(function() {
    var oTable = $('#example').dataTable();
    oTable.fnUpdate( 'Example update', 0, 0 ); // Single cell
    oTable.fnUpdate( ['a', 'b', 'c', 'd', 'e'], 1, 0 ); // Row
    } );
    [/code]
  • girishmrgirishmr Posts: 137Questions: 0Answers: 0
    http://datatables.net/blog/Inline_editing

    You can see this working in inline-editing.

    Thanks to Allan for putting this together
  • MightyCodderMightyCodder Posts: 3Questions: 0Answers: 0
    Thanks allot for the help. From now, I have all the features to start implementing datatables into my project.
  • MightyCodderMightyCodder Posts: 3Questions: 0Answers: 0
    I was actually searching for "edit row" & "modify row" in the documentation rather then update. Problem solved.
This discussion has been closed.