Quantcast
Viewing all articles
Browse latest Browse all 82110

fnUpdate row with sAjaxSource

I initialise a data table as follows:

     $('#teamTable').dataTable( {
          "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
          "sPaginationType": "bootstrap",
          "sLengthMenu": "_MENU_ records per page",
          "bProcessing": true,
          "sAjaxSource": '/base/Arc/TeamArray/4772/',
          "aoColumnDefs": [  { "mRender": function ( data, type, row ) {
              return '<a onclick="editTeam(' + row[0] + ')" ><i class="icofont-pencil"></i></a> <a onclick="doCasc(' + row[0] + ')" >' + data + '</a>';
          },
            "aTargets": ["tid"]
        } ]

so the mrender creates two links one of which initialises a cascaded child table and the first launch a modal to editTeam to edit the contents of the row (it's the design) when the modal is cleared I'd like the data in the row in the table to be updated

using the fnFindCellRowIndexes api plugin to find the row from the ID (this works nicely)
I'd then like to update the contents of the row
I'd prefer to do this rather than clear and recall the data source
afaik there is no way to ensure that after the reload the same order / paging / filtering will be in place
and the changed row may not even be visible
but as the button is clicked from within the visible row it seems fair to just update the changed row

var oTable = $('#teamTable').dataTable();
            var row = oTable.fnFindCellRowIndexes(id, 0);
            oTable.fnUpdate([tid, NewTeam['Name'], NewTeam['Role'], NewTeam['Manager'], NewTeam['Telephone'], NewTeam['Email'], 0], row); 

but it seems to not do anything
if update it as a and step through the code on the fourth iteration I get an error
Update TypeError: Cannot set property '_aData' of undefined

if i change it to update only a single cell then nothing at all happens
i've checked the variables in the last line above all exist and are the same type as the original input

any ideas ?

(sorry can't link to the broken page as it's within an intranet behind a firewall)

Viewing all articles
Browse latest Browse all 82110

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>