定制 marmarait/laraveldynamicsort 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

marmarait/laraveldynamicsort

Composer 安装命令:

composer require marmarait/laraveldynamicsort

包简介

Lets you sort your Models dynamically by querystring

README 文档

README

Overview

Simply sort your Models by using querystring parameters.

Install

composer require marmarait/laraveldynamicsort

Optionally you can also add the jQuery Plugin provided to do the frontend part.

php artisan vendor:publish --provider=MarmaraIT\LaravelDynamicSort\DynamicallySortableProvider

Somewhere in the part of your layout add

@include('laraveldynamicsort::short_sort')

  • If you are using gulp simply add "dynamicallySortable.js" to your gulpfile.js
  • If you are using laravel-mix add "resources/assets/js/dynamicallySortable.js" to your webpack.mix

Usage

Backend:

  • add the Trait "DynamicallySortable" to your model
  • use the scope "ordered" on the model to sort it by querystring:
  • add sort=COLUMNAME&dir=[[asc/desc]] to your query string to sort the active model

To use the jquery-plugin, give the table header(th) elements the attribute data-sort="COLUMNAME" and call the plugin $('.selector').dynamicallySortable() (selector = the th elements; f.e. $('th[data-sort]') )

Defaults

Set the defaultDir property on your model to define the default order direction (asc/desc)
Set the defaultSort property to set the default sorting column

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-12-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固