ArtiGrid
v1.6

Combobox relacional

The combobox() method allows you to transform a field into a dropdown (select) with dynamic or static data sources.

It supports two types of sources:

In this example, the officeCode field is linked to the offices table, using officeCode as the value and city as the label.

This makes it easy to handle relational data and improve form usability with user-friendly selections.


<?php
    $grid = new ArtiGrid();
    $grid->table('employees')
        ->template('bootstrap5')
        ->unset('filter', false)
        ->modal();
    $grid->combobox('lastName', [
        'Activate' => "Activate",
        "Desactive" => "Desactive"
    ]);
    $grid->combobox('officeCode','offices','officeCode','city');
    echo $grid->render();
?>
employeeNumber lastName firstName extension email officeCode reportsTo jobTitle Actions