jtmsa/jqgrid-bundle
Composer 安装命令:
composer require jtmsa/jqgrid-bundle
包简介
Symfony bundle for a powerful ajax-enabled grid - jqGrid or free jqGrid.
README 文档
README
Symfony bundle for a powerful ajax-enabled grid - jqGrid or free jqGrid.
Installation
The preferred way to install this extension is through composer.
- Either run
php composer.phar require --prefer-dist "himiklab/jqgrid-bundle" "*"
or add
"himiklab/jqgrid-bundle" : "*"
to the require section of your application's composer.json file. And registered HimiklabJqGridBundle in you application config.
- Assets
reqired: jqgrid or free-jqgrid with jquery of course
optional: @fortawesome/fontawesome-free or jquery-ui, bootstrap
- Template
{% block stylesheets %}
{{ encore_entry_link_tags('jqgrid') }}
{% endblock %}
{% block body %}
<table id="jqGrid-grid"></table>
<div id="jqGrid-pager"></div>
{% endblock %}
{% block javascripts %}
{{ encore_entry_script_tags('jqgrid') }}
<script>
$(document).ready(function () {
$("#jqGrid-grid").jqGrid({
//"guiStyle": "bootstrap4",
"url": "{{ path('customer_jqgrid_read') }}",
"datatype": "json",
"mtype": "post",
"pager": "#jqGrid-pager",
"colNames": ["ID", "Name", "Surname", "Birthplace", "Birthdate"],
"colModel": [
{{ jqgrid_colmodel(columns, columnsIsVisible, columnsIsEditable)|raw }}
],
"rowNum": 30,
"rowList": [30, 60],
"multiselect": true,
"multiSort": true,
"viewrecords": true
//"iconSet": "fontAwesomeSolid"
})
.navGrid('#jqGrid-pager', {
"edit": true,
"add": true,
"del": true,
"search": true,
"view": true
},
{
"url": "{{ path('customer_jqgrid_update') }}",
"afterSubmit": function (response) {
return [response.responseText === "", response.responseText, null];
}
},
{
"url": "{{ path('customer_jqgrid_create') }}",
"afterSubmit": function (response) {
return [response.responseText === "", response.responseText, null];
}
},
{"url": "{{ path('customer_jqgrid_delete') }}"},
{
"multipleSearch": true,
"multipleGroup": true,
"closeAfterSearch": true,
"showQuery": true,
},
{}
)
.filterToolbar({"stringResult": true});
});
</script>
{% endblock %}
- Controller
use himiklab\JqGridBundle\JqGrid; class CustomerController extends AbstractController { private $jqgrid; public function __construct(JqGrid $jqgrid) { $this->jqgrid = $jqgrid ->setEntityName(Customer::class); } /** * @Route("/jqgrid", methods={"GET"}) */ public function index(): Response { $columns = [ 'id' => ['type' => 'int',], 'fullName.name', 'fullName.surname', 'birthplace', 'birthdate' => ['type' => 'date'] ]; $columnsIsVisible = ['id', 'fullName.name', 'fullName.surname', 'birthplace', 'birthdate']; $columnsIsEditable = ['fullName.name', 'fullName.surname', 'birthplace', 'birthdate']; return $this->render( 'incoming/index.html.twig', ['columns' => $columns, 'columnsIsVisible' => $columnsIsVisible, 'columnsIsEditable' => $columnsIsEditable] ); } /** * @Route("/jqgrid/read", methods={"POST"}, name="customer_jqgrid_read") */ public function read(Request $request): Response { return $this->jqgrid->handleRead($request); } /** * @Route("/jqgrid/create", methods={"POST"}, name="customer_jqgrid_create") */ public function create(Request $request): Response { return $this->jqgrid->handleCreate($request) ?: new Response(); } /** * @Route("/jqgrid/update", methods={"POST"}, name="customer_jqgrid_update") */ public function update(Request $request): Response { return $this->jqgrid->handleUpdate($request) ?: new Response(); } /** * @Route("/jqgrid/delete", methods={"POST"}, name="customer_jqgrid_delete") */ public function delete(Request $request): Response { $this->jqgrid->handleDelete($request); return new Response(); } }
jtmsa/jqgrid-bundle 适用场景与选型建议
jtmsa/jqgrid-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 33 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 11 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「bundle」 「ajax」 「jqgrid」 「grid」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jtmsa/jqgrid-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jtmsa/jqgrid-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jtmsa/jqgrid-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
2lenet/EasyAdminPlusBundle
The bundle for easy using json-rpc api on your project
Selenium4 (WebDriver) driver for Mink framework
Provide a way to secure accesses to all routes of an symfony application.
laravel middleware to allow ajax only calls
DMS Meetup API Bundle, enables Meetup API clients in services
统计信息
- 总下载量: 33
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-27