Simple grid with basic functions.
Пример базовой таблицы.

Выводит данные из БД, осуществляет поиск и сортировку.
Позволяет свободно добавлять, изменять и удалять записи.
higrid.net嗨网提供电子表格、在线图形等互联网开发及运营技术,提供相关资料及软件下载,分享奇趣网络时事评论!欢迎访问。


部分内容为俄文,higrid计划翻译一下。敬请期待!

php代码和js代码请点击tab查看。
<?php

class jqSimple extends jqGrid
{
    protected function init()
    {
        #Set database table
        $this->table = 'tbl_customer';

        #Make all columns editable by default
        $this->cols_default = array('editable' => true);

        #Set columns
        $this->cols = array(

            'id' => array('label' => 'ID',
                'width' => 10,
                'align' => 'center',
                'editable' => false, //id is non-editable
            ),

            'first_name' => array('label' => 'First name',
                'width' => 35,
                'editrules' => array('required' => true),
            ),

            'last_name' => array('label' => 'Last name',
                'width' => 35,
                'editrules' => array('required' => true),
            ),

            'email' => array('label' => 'Email',
                'width' => 30,
                'editrules' => array('email' => true),
            ),

            'phone' => array('label' => 'Phone',
                'width' => 25,
                'align' => 'center',
            ),

            'discount' => array('label' => 'Discount',
                'width' => 15,
                'formatter' => 'numeric',
                'align' => 'center',
                'editable' => false,
            ),
        );

        #Set nav
        $this->nav = array('add' => true, 'edit' => true, 'del' => true);

        #Add filter toolbar
        $this->render_filter_toolbar = true;
    }
}
<script>
    <?= $rendered_grid ?>
</script>