How to disable the table state saving?

By default, the DataTables Extension stores information like pagination position, display length, filtering, sorting, etc., using the browser. This way, when the page is reloaded, you don't lose your place. DataTables calls this the "state" of the table.

For some applications, you may want to ensure that the view state is not kept in the browser, so you'll need to disable this setting on your DataTables view. To accomplish that, add the following code to your website:

 * Disable the State Saving on your DataTables view
 * @link
add_filter( 'gravityview_datatables_js_options', 'my_gv_state_save', 20, 2 );

 * @param array $config Holds the DataTables table configuration 
 * @param string $view_id The current view id
function my_gv_state_save( $config, $view_id ) {
	$config['stateSave'] = false;
	return $config;

Read here how to add these code samples to your website: Where to put code samples.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us