Skip to content

Commit

Permalink
修改Grid Actions ,添加了获取当前行信息的方法
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallRuralDog committed Mar 28, 2020
1 parent 1f4e02d commit 13f7992
Show file tree
Hide file tree
Showing 14 changed files with 136 additions and 120,931 deletions.
2 changes: 1 addition & 1 deletion docs/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ export default {
},
computed: {
uri() {
//替换变量
//替换变量 ,新版已经可以在php端获取当前行对象了
let uri = this.action.uri;
this._.forEach(this.row, (value, key) => {
uri = this._.replace(uri, "{" + key + "}", value);
Expand Down
23 changes: 23 additions & 0 deletions docs/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,34 @@ $grid->column('permissions.roles.administrators.name')->displayComponent(Tag::ma

```php
$grid->actions(function (Grid\Actions $actions) {

$actions->getKey();//获取当前行的 index v0.1.5 +

$actions->getRow();//获取当前行的对象,注意是对象不是数组 v0.1.5 +

$actions->hideEditAction();
$actions->hideViewAction();
})
```

#### 获取当前行的 index

v0.1.5 +

```php
$actions->getKey();
```

#### 获取当前行的对象

获取当前行的对象,注意是对象不是数组 v0.1.5 +

```php
$actions->getRow();
```



#### 隐藏所有操作

```php
Expand Down
Loading

0 comments on commit 13f7992

Please sign in to comment.