ArtiGrid
v2.0

Modal In Action Buttons

Custom Modal Action Button: This demo shows how to add a custom action button to each row and open a custom form inside a modal. The button is displayed only when the officeCode value is 1. The modal can be customized with a title, size, header style, and automatic closing after saving.


<?php
    $grid = new ArtiGrid();
    $grid->table('employees')
        ->template('bootstrap5')
        ->addCustomBtn(
            'btn btn-sm btn-warning',
            'popup-form',
            '<i class="fa fa-pencil"></i> Assign',
            'Assign',
            ["officeCode", "==", "1"],
            '',
            '_self',
            [
                'data-id'                 => '{employeeNumber}',
                'data-modal-url'          => 'modal_custom.php?id={id}',
                'data-modal-title'        => 'Assign Tickets',
                'data-modal-size'         => 'modal-md',
                'data-modal-header-class' => 'bg-success text-white',
                'data-modal-close-on-save'=> 'true'
            ]
        );
    echo $grid->render();
?>
employeeNumber lastName firstName extension email officeCode reportsTo jobTitle Actions