{hero}

rowgroup-datasrc

Since: RowGroup 1.0.0

Grouping data property has been changed.
Please note - this property requires the RowGroup extension for DataTables.

Description

The ability to change the data point that is used to group a table can be useful, allowing the end user to easily group data in different ways, but when that happens you may wish to also update the table's settings - the most typical being using ordering in the table to reflect the new grouping.

This event is triggered whenever the data source for the grouping is modified, providing you with that ability to modify the table's settings.

Type

function function( e, datatable, prop )

Parameters:

Example

Change the fixed ordering when the data source is updated:

table.on( 'rowgroup-datasrc', function ( e, dt, val ) {
	table.order.fixed( {pre: [[ val, 'asc' ]]} ).draw();
} );

Related

The following options are directly related and may also be useful in your application development.