Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81728

Feature request: Allow successCallback data of ajax not to be merged with existing row data.

$
0
0

Hello, currently, if you have set drawType === 'none', you need to manually pass new or updated row data to successCallback as a result of ajax request to make the table row update itself with the new data. The passed row data is then internally merged with existing table row data, to fill in missing properties, in case just a sub-set of row fields was returned. However, in our business case, we also expect that some of the fields are missing intentionally in the returned set of data, and we render these columns in a specific way. However, editor fills in these missing fields with cached table row fields.
Here's a snippet from editor 1.9.2 starting at line #6956:

// Merge data to allow for a sub-set to be returned
var extender = $.fn.dataTableExt.oApi._fnExtend;
var toSave = extender( {}, row.data(), true );
toSave = extender( toSave, data, true );

row.data( toSave );

Could this behaviour be optionally disabled, so user can manually set, what data are passed back to datatable renderers after successful edit?
Proposal: Add a switch setting, for example allowSubsetResponse, which when set to false, would not automatically merge the data passed to successCallback with respective table row data.

Thanks for the response.
Rado


Viewing all articles
Browse latest Browse all 81728

Trending Articles



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