cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.x Listing Ui Component Grid Action with Ajax Link

Magento 2.x Listing Ui Component Grid Action with Ajax Link

Hi,

 

In a grid, how to set a new link in action column for an ajax call (already having 2 links in dropdown menu as view, edit). Need to trigger an ajax call with some parameter to pass on. Please advise.

RemoveAction.php

$removeUrlPath = $this->getData('config/removeUrlPath') ?: '#';
$href = $this->urlBuilder->getUrl(
    $removeUrlPath,
    [
        'id' => $item['entity_id'],
        'name'=> $item['name']
    ]
);
$item[$this->getData('name')]['remove'] = [
        'href' => $href,
        'target' => '_blank',
        'label' => __('Remove')
// how set ajax call here? ];