[英]Reorder operation is not working in backpack for laravel
Reorder operation is not working in backpack for laravel.重新订购操作在 laravel 的背包中不起作用。
Migration file:迁移文件:
public function up()
{
Schema::table('complexities', function (Blueprint $table) {
$table->integer('parent_id')->default(0)->nullable();
$table->integer('lft')->default(0)->nullable();
$table->integer('rgt')->default(0)->nullable();
$table->integer('depth')->default(0)->nullable();
});
}
Crud controller粗鲁 controller
use ReorderOperation;
..........
.........
protected function setupReorderOperation()
{
$this->crud->set('reorder.label', 'title');
$this->crud->set('reorder.max_level', 2);
}
I am getting the Reorder UI, But it is not working.我收到了重新排序用户界面,但它不起作用。 I mean can reorder the list, But no effect in database and list becomes in old order when I reload it.我的意思是可以重新排序列表,但是在数据库中没有任何影响,并且当我重新加载它时列表变成旧顺序。
Not sure about the nullable
on all fields.不确定所有字段是否可为nullable
。 Please try with请尝试
public function up()
{
Schema::table('complexities', function (Blueprint $table) {
$table->integer('parent_id')->nullable()->default(0);
$table->integer('lft')->default(0);
$table->integer('rgt')->default(0);
$table->integer('depth')->default(0);
});
}
Also check if there are any values stored for these fields in the database.还要检查数据库中是否为这些字段存储了任何值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.