Recent Topics

Datagrid Action Into Add Condition



  • Hi,
    We want to overwrite datagrid action coloum as in admin module order listing page default
    action is view but we want to add one more action here so we added that. But we want to also put condition here so if condition true then that action show otherwise not display.



  • Hi @Shambhu

    Create a datagrid (Order) in your package with your condition, then you need to override order index file, after overriding it, call your datagrid to render.
    Using this way, you can show your datagrid.

    Read this one for overriding view - https://forums.bagisto.com/topic/111/how-to-override-the-admin-layout

    Thanks



  • I will override the index file but how to add the status wise condition below this code.

        $this->addAction([
            'type' => 'View',
            'method' => 'GET', // use GET request only for redirect purposes
            'route' => 'admin.sales.orders.view',
            'icon' => 'icon eye-icon'
        ]);
    
        $this->addAction([
            'type' => 'View',
            'method' => 'GET', // use GET request only for redirect purposes
            'route' => 'admin.sales.orders.edit',
            'icon' => 'icon eye-icon'
        ]);

Log in to reply