ArtiGrid
v2.0

Column Filter Visibility

This demo shows how to control the visibility of individual column filters in ArtiGrid. The setColumnFilterVisibility() method allows you to hide a filter for a specific column while keeping the column itself available in the grid.

In this example, the filter for the productCode column is hidden, which can be useful when a column should remain visible but does not require user filtering.

The column is still available for CRUD operations and validation. The validation_required() method ensures that productCode remains a required field when adding or editing a product.


<?php
    $grid = new ArtiGrid();
    $grid->table('products')
        ->template('bootstrap5')
        ->required(false)
        ->setColumnFilterVisibility('productCode', false)
        ->showColumnFilter('rut')                     // shortcut show
        //->hideColumnFilter(['productCode', 'role']) // shortcut hide
        //->onlyColumnFilters(['rut', 'nombre'])      // Only these, the rest hidden
        ->validation_required('productCode')
        ->perPage(10)
        ->modal();
    echo $grid->render();
?>
id productCode productName productLine productScale productVendor productDescription quantityInStock buyPrice MSRP Actions