0

I use layout block to create grid page, but it does't inclue actions column so can I create dropdown actions edit and delete use layout block file Grid.php

$this->addColumn(
        'actions',
        [
            'header'=>__('Action'),
            'index'=>'actions'
        ]
    );

My grid page enter image description here

the grid page i want

Heading

  • have you followed UI component ? – liyakat Aug 18 '17 at 5:15
1

This can help you for adding new action in to the grid which is created through the Grid.php file.

  $this->addColumn(
        'action', [
            'header' => __('Action'),
            'type' => 'action',
            'getter' => 'getId',
            'actions' => [
                [
                    'caption' => __('Edit'),
                    'url' => ['base' => '*/*/edit'],
                    'field' => 'id',
                ],
                [
                    'caption' => __('Delete'),
                    'url' => ['base' => '*/*/delete'],
                    'field' => 'id',
                ],
            ],
            'filter' => false,
            'sortable' => false,
            'index' => 'stores',
            'header_css_class' => 'col-action',
            'column_css_class' => 'col-action',
        ]
    );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.