Git Product home page Git Product logo

Comments (4)

fvanzeijl avatar fvanzeijl commented on May 11, 2024 4

Ah, finally I got it.
Tried so hard to use native table-action. But I had to simple override the package-action.

protected function configureEditAction(Actions\EditAction $action): Actions\EditAction {
  $action->link()->url(fn(Page $page) => route('filament.admin.resources.pages.edit', $page->id));
  return $action;
}

Thank you!

from filament-tree.

Hegabovic avatar Hegabovic commented on May 11, 2024 1

yes, but i think they are extending the same filament Action

from filament-tree.

Hegabovic avatar Hegabovic commented on May 11, 2024

yes you can do that, by enabling the function hasView for example make it return true , and then use the confugureViewAction method override it then use URL to redirect to the normal page of your table action

for example

use Filament\Tables\Columns\TextColumn;
 
TextColumn::make('title')
    ->url(fn (Post $record): string => route('posts.edit', ['post' => $record]))

from filament-tree.

fvanzeijl avatar fvanzeijl commented on May 11, 2024

Thank you.

The problem is, I can not override the configureViewAction-method (or any other viewMethods) because it have to has the same declaration as it has in the BasePage-Class.

In short I can not change the type of the given action in the method, so the following code will end in declaration-error.

use Filament\Tables\Actions\EditAction;

protected function configureEditAction(EditAction $action): EditAction
{
    return parent::configureEditAction($action)
        ->authorize(fn (Model $record): bool => static::getResource()::canEdit($record));
}

It has use the EditAction from
SolutionForest\FilamentTree\Actions\EditAction not the table-action (or any other native actions from filament)

from filament-tree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.