Laravel-admin: [REQUEST] GRID Add Numerical order first column

Created on 30 Apr 2018  ·  4Comments  ·  Source: z-song/laravel-admin

  • Laravel Version: 5.5
  • PHP Version: 7.2
  • Laravel-admin: 1.5.dev

Description:

How to create a column with 1, 2 ,3.. number on GRID not base on the column on model

Most helpful comment

I just pushed a commit cdad43b to make number property of Grid\Row public, so you can do this:

$grid->rows(function (Grid\Row $row) {
   $row->column('number', $row->number);
});

// Your custom column.
$grid->column('number');

Update laravel-admin to 1.5.x-dev

All 4 comments

@z-song Any suggestion ?

I just pushed a commit cdad43b to make number property of Grid\Row public, so you can do this:

$grid->rows(function (Grid\Row $row) {
   $row->column('number', $row->number);
});

// Your custom column.
$grid->column('number');

Update laravel-admin to 1.5.x-dev

It is working
image

$grid->rows(function (Grid\Row $row) {
$xRow = Photo::find($row->id);
$img = '';
$row->column('Image', $img);
});

$grid->column('Image');

Was this page helpful?
0 / 5 - 0 ratings

Related issues

greentornado picture greentornado  ·  3Comments

evans-kim picture evans-kim  ·  3Comments

benny-sun picture benny-sun  ·  3Comments

wangwenfan picture wangwenfan  ·  3Comments

zhenyangze picture zhenyangze  ·  3Comments