DataTables/Plugins — pull request #8 by chmielot (2013-02-02 17:01:16+00:00)
Title: Extend fnAddTr to allow updating an existing TR node instead of adding

Use case is the following:

Given a DataTable with an actions column. One of the actions changes the row's data via ajax, so that the row actually changed. The ajax request returns a freshly rendered row for the changed entity. To not reload the whole table and lose current filter, pagination or any other settings, the row should be updated.

fnAddTr only allows to add new rows. This patch adds a parameter which can be a TR node or an index, like described in the fnUpdate API. If this parameter is set, the passed node will be updated with the new one.

I'm just not sure if extending fnAddTr is the best idea. Alternatives are:
1. Rename fnAddTr to something more descriptive
2. Instead of modifying fnAddTr, add a new plugin fnUpdateTr. That'll mean code duplication, as the code would be nearly the same as fnAddTr.

What do you think?