ArtiGrid
v1.6

Order By

The orderby() method allows you to sort the grid data by a specific column and direction.

You can define the field and the order type, such as asc (ascending) or desc (descending).

This helps you control how data is displayed by default without modifying the query.


<?php
    $grid = new ArtiGrid();
    $grid->table('payments')
        ->template('bootstrap5')
        ->orderby('paymentId', 'desc')
        ->formFields(['customerNumber','checkNumber', 'amount'])
        ->modal();
    echo $grid->render();
?>
paymentId customerNumber checkNumber paymentDate amount Actions