ArtiGrid
Checkbox Conditions
Checkbox conditions let you control whether the selection checkbox is shown on each row, based on that row's own field values. Rows that fail the condition are rendered without a checkbox, so they cannot be selected or included in any bulk operation.
In this demo, the condition ['id', '!=', 2] hides the checkbox for the
record with id = 2. Combined with
setActionCondition('delete', ['id', '!=', 2]), that record is fully
protected — its delete button is hidden and it can no longer be picked for a bulk
delete, keeping it safe from accidental removal.
<?php
$grid = new ArtiGrid();
$grid->table('gallery')
->required(false)
->validation_required('image')
->validation_required('title')
->validation_required('description')
->template('bootstrap5')
->fieldType('image', 'image')
->formFields([
'image',
'title',
'description'
])
->modal()
->setActionCondition('delete', ['id', '!=', 2])
->checkboxCondition(['id', '!=', 2]);
echo $grid->render();
?>