Usage
To use the FilterResetButton
, you need to include it in the getFilterResetButton
method of your grid class. Here is an example:
use BoredProgrammers\LaraGrid\Filters\FilterResetButton;
class MyGrid extends BaseLaraGrid
{
protected function getFilterResetButton(): array
{
return FilterResetButton::make()
->setRenderer(function () {
return view('my-grid.filter-reset-button');
})
->setRenderer(fn() => 'Reset button')
->setRenderer(function() {
return "<b>Reset button</b>";
})
->setAttributes([
'id' => 'my-custom-id',
'data-foo' => 'bar',
]);
}
}
In this example, FilterResetButton::make()
creates an instance of the FilterResetButton
component. This button will be added to the grid.
Last updated
Was this helpful?