I have created custom admin grid which contains column name sku.
How to make this sku field value into url.That url go for product edit page.
In layout file
<column name="product_sku" class="Xxx\Stock\Ui\Component\Listing\Columns\Product">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Sku</item>
</item>
</argument>
</column>
Product.php
public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {
$fieldName = $this->getData('name');
foreach ($dataSource['data']['items'] as & $item) {
if (isset($item[$fieldName])) {
$html = "<a href='" . $this->context->getUrl('adminhtml/catalog_product/edit',['id'=>$item[$fieldName]]) . "'>";
$html .= __('Product Page');
$html .= "</a>";
$item[$fieldName] = $html;
}
}
}
return $dataSource;
}
Its not working....