When working on large or small-scale projects in CS-Cart, managing CRUD operations in the admin panel can be time-consuming.
That’s where the CS-Cart DataGrid comes in—a custom solution designed to drastically reduce development time and deliver faster projects with minimal effort.
What is CS-Cart DataGrid?
CS-Cart DataGrid is a versatile and reusable CRUD component built specifically for CS-Cart and admin panels. Moreover, it simplifies CRUD operations, making CS-Cart development faster and easier.
How is DataGrid Time-Saving and Cost-Effective for Your Projects?
DataGrid helps save time by handling common tasks like filtering, sorting, exporting, and bulk actions. Additionally, it’s easy to set up and use, which makes managing CRUD faster and smoother.
In CS-Cart projects, basic tasks like creating or updating records can be done in hours instead of days. As a result, this means quicker delivery, lower costs, and happier clients.
Key Features of DataGrid’s
DataGrid is built using CS-Cart’s core tools, so it works smoothly and performs well. Here are the features
- Pagination
- Sorting
- Filtering
- Search
- Bulk actions ( Bulk delete, update, etc.)
- Export data ( CSV, XML )
- Editable in fields
- Save Searches
How Developers Easily Develop a CRUD using DataGrid
How DataGrid Works
To use DataGrid in a CS-Cart project, the CS-Cart Developer simply creates the DataGrid, view, and route handler files. After that, customize the DataGrid as needed, and the CRUD interface is ready
Sample DataGrid
<?php namespace DataGrid; use Tygh\Addons\Wkdatagrid\DataGrid\src\DataGrid; class EmployeeDataGrid extends DataGrid { public function prepareQueryBuilder() { // sql queries } public function prepareColumns(): void { $this->addColumn([ 'index' => 'e.name', //table column name 'label' => __('name'), 'type' => 'string', //Boolean, Date, Integer, Text, Datetime 'sortable' => true, 'searchable' => true, 'filterable' => true, 'closure' => function($row) { return ($row->status) ? 'Active' : 'Disabled'; } //customization to the value. ]); } public function prepareActions() { $this->addAction([ 'icon' => 'ty-icon-delete', 'title' => __('delete'), 'class' => 'cm-ajax cm-confirm', 'method' => 'POST', 'type' => 'delete', 'url' => function ($row) { return fn_url("wk_erp_saved.delete?id=$row->id", 'A'); }, ]); } }
Handing Route
<?php namespace EmployeeController; use Tygh\Tygh; use Tygh\Registry; use DataGrid\EmployeeDataGrid; require_once(Registry::get('config.dir.addons') . 'wk_datagrid/src/DataGrid/src/Http/helpers.php'); class Employee extends BaseController { public function __construct($mode) { parent::__construct($mode); $this->setRunMode(['m_delete', 'm_update', 'update', 'delete', 'manage']); if (in_array($this->mode, $this->runMode)) { $this->$mode(); } } public function manage() { list($lists, $search) = fn_datagrid(EmployeeDataGrid::class)->process(); Tygh::$app['view']->assign('lists', $lists); Tygh::$app['view']->assign('search', $search); } }
Render DataGrid
{include file="addons/wk_datagrid/data-grid.tpl" search_form_dispatch="emp.manage" saved_search_name="emp" export=true is_editable="emp.m_update" page_title=__('emp.erp_templates') search_form_prefix="emp" content_id="content_emp" name="emp" search_label="Search Templates" data=$lists hook="emp" column_width=[10,10,25,30,10] }
Why Use DataGrid?
- Rapid Setup: No need to manually handle sorting, pagination, exporting data, or filtering logic.
- Reusable Architecture: Define columns, filters, actions, and queries in a clean, organized structure.
- Fully Extensible: Easily integrates with add-ons or custom admin modules.
- Performance-Oriented: Built to handle large datasets efficiently using optimized SQL.
- Clean UI Integration: Grids are rendered using native Smarty templates or can be customized.
Support:
Still have any queries, feel free to ask by creating a ticket
Besides this, you can explore our CS-Cart Development Services and Quality CS-Cart add-ons.
Current Product Version – 1.0
law
Pendidikan
Pendidikan
Download Anime
Berita Teknologi
Seputar Teknologi
Leave a Reply