Open Bazinel opened 5 years ago
I looked at how routes are formed for viewing and deleting in the file RendersButton.php. For view:
'url' => function ($gridName, $item) {
return $this->getViewUrl([
$gridName => $item->{$this->getDefaultRouteParameter()}, 'ref' => $this->getId()
]);
}
For delete:
'url' => function ($gridName, $item) {
return route($this->getDeleteRouteName(), [
$gridName => $item->{$this->getDefaultRouteParameter()}, 'ref' => $this->getId()
]);
}
Added this code to configureButtons()
method for view button
'url' => function ($gridName, $item) {
return route($this->getViewRouteName(), [
$gridName => $item->{$this->getDefaultRouteParameter()}, 'ref' => $this->getId()
]);
}
The problem was solved, but I do not think that this is the right way.
When the filter is applied, the address for the browse button should look like
http://site.com/admin/city/edit/10?ref=city-grid
but instead it is formed like thishttp://site.com/admin/city/edit?name=Boston&city=1&ref=city-grid
. At this route for removal it is formed correctly irrespective of use of the filter or sorting. Rule in web.php look like thisRoute::match(['get','post'], '/city/edit/{id}', ['uses' => 'Admin\CityController@edit', 'as' => 'city.edit']);