<?php
global $gdb;

$grid = new \grid( 'globelus_countries' );
$grid -> gdb_opt      = $gdb;
$grid -> order        = [ 'column' => 'name', 'type' => 'ASC' ];
$grid -> search       = [
                          [ 'name' => 'Nazwa', 'db' => 'name', 'type' => 'text' ]
                        ];
$grid -> columns_view = [
                          [
                            'name' => 'Lp.',
                            'th' => [ 'class' => 'g-lp' ],
                            'td' => [ 'class' => 'g-center' ],
                            'autoincrement' => true
                          ],
                          [
                            'name'  => 'Nazwa',
                            'db'    => 'name',
                          ]
    ];
$grid -> columns_edit = [
                          [
                            'name'    => 'Nazwa',
                            'db'      => 'name',
                            'type'    => 'text',
                            'require' => true
                          ]
                        ];
$grid -> actions = [ 'edit' => true, 'add' => true, 'delete' => true ];
echo $grid -> draw();