There is a custom button class (extends from Encore\Admin\Actions\RowAction).
The class has a confirmation window with unique information for each row.
/ **
* @return void
* /
public function dialog()
{
$model = Categories::where('id',$this->getKey())->with('users')->get();
$this->question(trans('admin.delete_confirm'), 'Comment:'.$model[0]->comment, ['confirmButtonColor' => '#d33']);
}
When scripts are formed to invoke a dialog, they have the same class identifier (for example, ".grid-row-action-5dca9548c28226038"), but different text.
...
$ ('.grid-row-action-5dca9548c28226038').off('click').on('click', function() {
...
"text": "Comment: text 1",
...
}
$ ('.grid-row-action-5dca9548c28226038').off('click').on('click', function() {
...
"text": "Comment: text 2",
...
}
$ ('.grid-row-action-5dca9548c28226038').off('click').on('click', function() {
...
"text": "Comment: text 3",
...
}
...
How to make Laravel admin generate a unique identifier for each line?