Button Filter

Button path filter is used to show or hide HTML elements depending on their path and user selection.

<a 
    href="#"  
    data-grid-control="button-filter" 
    data-path=".red">Red</a>

It also can be a button:

<button 
    type="button" 
    data-grid-control="button-filter" 
    data-path=".red">Red</button>

If the data-value attribute is specified, the filter will look for this text value in the provided data-path. In this case, the following data attributes may be specified:

If the button is checked, it has dg-checked CSS class. This way it's possible to add styles to the selected button:

.dg-checked{
    color: red;
}

Last updated