dcat-admin / grid-sortable Goto Github PK
View Code? Open in Web Editor NEW这个插件可以帮助你通过拖动数据列表的行来进行排序,前端基于jQueryUI sortable, 后端基于eloquent-sortable。
License: MIT License
这个插件可以帮助你通过拖动数据列表的行来进行排序,前端基于jQueryUI sortable, 后端基于eloquent-sortable。
License: MIT License
Hello,
I made Dcat-Admin 2.0 port of this code: https://github.com/shacky/grid-sortable
If you could make a 2.0 branch I would pull request it to that branch... Or you can take the code and publish it here.
`
class UserTag extends BaseModel implements Sortable
{
use SortableTrait;
public $sortable = [
'order_column_name' => 'popular',
'sort_when_creating' => true,
];
}
return Grid::make(new UserTag(), function (Grid $grid) {
$grid->popular->sortable();
});
`
The vendor folder is giving 404 because 'vendor/dcat-admin-extensions/grid-sortable/sortable.min.js',
should be 'vendors/dcat-admin-extensions/grid-sortable/sortable.min.js',
protected static $js = [
'vendor/dcat-admin-extensions/grid-sortable/sortable.min.js',
];
PHP版本:PHP 7.4.29 (cli) (built: Apr 21 2022 10:16:17) ( NTS )
Laravel版本:6
Dcat版本:v2.2.0-beta
报错信息如下:
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Generating optimized autoload files
post-autoload-dump: Illuminate\Foundation\ComposerScripts::postAutoloadDump
PHP Fatal error: Uncaught Error: Call to undefined method Dcat\Admin\Admin::extend() in /home/longfei/www/test_larave/vendor/dcat-admin-extension/grid-sortable/src/bootstrap.php:4
Class name must be a valid object or a string
我數據庫名欄位就是叫sort
int(6)
//App/Models/xxx.php
public $sortable = [
'order_column_name' => 'sort',
'sort_when_creating' => true,
];
在admin 的相關Controller 中grid()
加入了 $grid->sortable();
但還是報這個錯
可以拖動,也沒報錯,只有按下保存的那一刻才報錯
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.