{hero}

searchPanes.rebuildPane()

Since: SearchPanes 1.0.0

Rebuild the pane, regathering options from the table.
Please note - this property requires the SearchPanes extension for DataTables.

Description

This method provides the ability to rebuild the panes should a change occur on the associated DataTable.

If no argument is provided to searchPanes.rebuildPane() then all of the panes will be rebuilt.

Otherwise, the searchPanes.rebuildPane() function takes in the index of the pane. The index of the panes include hidden panes and custom panes - to rebuild the second column's associated pane call searchPanes.rebuildPane(1). As custom panes come after the column's panes, to rebuild the first custom pane where a table has five columns then the command to run would be searchPanes.rebuildPane(5) (note counting starts from zero). A second parameter is available which allows the selections to be maintained when a rebuild is called. It is a boolean value with a default of false.

Types

function searchPanes.rebuildPane()

Description:

Rebuild all panes, regathering options from the table.

function searchPanes.rebuildPane( index )

Description:

Rebuild specific pane, regathering options from the table.

Parameters:
Returns:

DataTables API instance

function searchPanes.rebuildPane( index [, maintainSelect ] )

Description:

Rebuild specific pane, regathering options from the table and maintaining the selections present in the pane.

Parameters:
Returns:

DataTables API instance

Examples

Delete a row and redraw the first pane:

var dt = new DataTable('#myTable', {
	layout: {
		top1: 'searchPanes'
	}
});

dt.row(0).remove();
dt.searchPanes.rebuildPane(0);

Delete a row and redraw all of the panes:

var dt = new DataTable('#myTable', {
	layout: {
		top1: 'searchPanes'
	}
});

dt.row(0).remove();
dt.searchPanes.rebuildPane();

Redraw the first pane while maintaining selections:

var dt = new DataTable('#myTable', {
	layout: {
		top1: 'searchPanes'
	}
});

dt.searchPanes.rebuildPane(0, true);