承接 fantomx1/datatables 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fantomx1/datatables

Composer 安装命令:

composer require fantomx1/datatables

包简介

package under development

README 文档

README

generic framework-agnostic composer installable data-tables

After installing this library via composer install fantomx1/datatables , install the library's assets as follows (it utilizes package fantomx1/packages-assets-support for the operation)

Installing this library's assets

execute this command

cd vendor/fantomx1/datatables && php ../../../vendor/fantomx1/packagesAssetsSupport/initAssets.php -w=../../../backend/web -o=assets

where the -w option stands for the relative path to the documentRoot/webDir directory, where to position the assets (Note: later can be added functionality of the command asking interactively for the documentRoot location, plus hooking up on composer post-install )

Example:

Showcase

Usage:

(with columnsDefinitions builder) - really nothing else anymore, and the table is fully functional sortable, filterable


        $articleTableWidget = new DataTableWidget();

        // will be needed also at column
        $articleTableWidget->_assoc_ini->setIni(
            $articleTableWidget->_assoc_ini::INI_QUERY_EXECUTOR,
            YiiQueryExecutorPlugin::class
        );

        $articleTableWidget->init();

        $articleTableWidget->setQuery("
            SELECT
                a.*
                ac.title as category_id,
            FROM article a
            JOIN article_category ac ON a.category_id = ac.id  
        ");

        $articleTableWidget->setColumnsDefinition(
            [
                $articleTableWidget->column('category_id')
                    ->setFilter()
                        ->setTypeSelect()
                        ->setDataQuery(
                            "article_category",
                            "id",
                            "title"
                        )->getFilter()
                    ->setCaption('Category')
                    ->setOrderable(),
                $articleTableWidget->column('slug')
                    ->setFilter()
                        ->setTypeSelect()
                        ->setData(
                            [
                                '1'=>'aaa',
                                '2'=>'bbb',
                                '3'=>'ccc'
                            ]
                        )->getFilter()
                    //->setCaption('aaa')
                    ->setOrderable(),
                $articleTableWidget->column('id')
                    ->setFilter()
                        ->setTypeText()
//                        ->setData(
//                            [
//                                '1'=>'aaa',
//                                '2'=>'bbb',
//                                '3'=>'cccc'
//                            ])
                        ->getFilter()
                    //->setCaption('bbb')
                    ->setOrderable()
            ]
        );

        // perhaps passed to some view
        $articleTableWidget->run();

Roadmap: https://trello.com/b/7wwQRgNq/fantomx1-datatablesbacklog

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-07-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固