Plugin for batch cell update
Plugin for batch cell update
Hello All, I'm new with DataTables and this forum.
Could someone review that plugin for problems or something that I shouldn't do?
This plugin should call only one rerender per multiple row updates.
[code]
(function($) {
/**
* This will create batch update of multiple rows with one rerender.
* It`s implemented in datatables plugin style.
*
* @param rows {
* iRow1 : [data,data,data,data]
* }
*/
$.fn.dataTableExt.oApi.fnUpdateRows = function(oSettings,rows) {
for (var iRow in rows) {
//Sets internal data
oSettings.aoData[iRow]._aData = rows[iRow].slice();
//Gets array of row tds
var tds = oSettings.oApi._fnGetTdNodes(oSettings, iRow);
for ( var iColumn=0 ; iColumn
Could someone review that plugin for problems or something that I shouldn't do?
This plugin should call only one rerender per multiple row updates.
[code]
(function($) {
/**
* This will create batch update of multiple rows with one rerender.
* It`s implemented in datatables plugin style.
*
* @param rows {
* iRow1 : [data,data,data,data]
* }
*/
$.fn.dataTableExt.oApi.fnUpdateRows = function(oSettings,rows) {
for (var iRow in rows) {
//Sets internal data
oSettings.aoData[iRow]._aData = rows[iRow].slice();
//Gets array of row tds
var tds = oSettings.oApi._fnGetTdNodes(oSettings, iRow);
for ( var iColumn=0 ; iColumn
This discussion has been closed.
Replies
One thing that I can see is that I don't think it will cope with objects being used for the data source: http://datatables.net/blog/Extended_data_source_options_with_DataTables . Implementing that can get a little messy (see my fnUpdate code...) due to the nesting of objects, so I wonder if it might be an idea to just loop over the data and pass it to fnUpdate with fnUpdate set to not redraw, and then when the loop is done do a redraw?
Allan