承接 rampesna/jqx-server-side 相关项目开发

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

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

rampesna/jqx-server-side

最新稳定版本:v1.1.0

Composer 安装命令:

composer require rampesna/jqx-server-side

包简介

JQX Server Side is a PHP library that helps you to create a server side for JQX DataTables.

README 文档

README

This package has been meticulously designed to optimize JqxGrid for server-side operations for Laravel and other PHP projects. With this integration, users can now seamlessly manage vast datasets and improve overall performance. Harness the full potential of JqxGrid with our specialized server-side solution.

Total Downloads GitHub repo size Build

Requirements

  • PHP >= 8.0
  • Illuminate/Database >= 8.0
  • Illuminate/Htpp >= 8.0

Installation

composer require rampesna/jqx-server-side

Usage

Controller

use Rampesna\JqxGrid;

class ExampleController extends Controller
{
    public function index(Request $request)
    {
        $tableName = 'your_table_name';
        $columns = [
            'id',
            'name',
            'surname',
            // ...
        ];
        
        $jqxGrid = new JqxGrid(
            $tableName,
            $columns,
            $request
        );
        
        return response()->json($jqxGrid->initialize());
    }
}

View

var yourGridDiv = $('#your-grid-div');

var source = {
    datatype: "json",
    datafields: [
        {name: 'id', type: 'integer'},
        // your columns ...
    ],
    cache: false,
    url: 'your_controller_url',
    beforeSend: function(xhr) {
        // if you need to send authorization token
        xhr.setRequestHeader('Authorization', 'Bearer ' + your_token);
        xhr.setRequestHeader('Accept', 'application/json');
    },
    beforeprocessing: function (data) {
        source.totalrecords = data[0].TotalRows;
    },
    root: 'Rows',
    filter: function () {
        yourGridDiv.jqxGrid('updatebounddata', 'filter');
    },
    sort: function () {
        yourGridDiv.jqxGrid('updatebounddata');
    }
};

var dataAdapter = new $.jqx.dataAdapter(source);

yourGridDiv.jqxGrid({
    // other options ...
    source: dataAdapter,
    filterable: true,
    showfilterrow: true,
    pageable: true,
    sortable: true,
    virtualmode: true,
    rendergridrows: function (params) {
        return params.data;
    },
    columns: [
        {
            text: '#',
            dataField: 'id',
            columntype: 'textbox',
        },
        // your columns ...
    ],
});

License

MIT License

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-12