Facet change

DescriptionDescription

This event is triggered when a facet changes and before content is refreshed.

ArgumentsArguments

ArgumentTypeDescription
slugstringFacet slug
valuesarrayFacet values

ExampleExample

JS
Grid settings – JS field
wpgb.facets.on( 'change', function( slug, values ) {

	// We change the price range
	if ( slug === 'price_range' ) {
		this.setParams( slug , [10, 20] );
	}

} );