How do I disable grid click? So I can only click "Edit" link.
I've tried changing the function in vendor/magento/module-catalog/Block/Adminhtml/Product/Grid.php
to return false;
but it didn't work.
Help is very appreciated.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityTo remove row url on grid, you need to edit function getRowUrl in file Grid.php as below:
public function getRowUrl($row){
return false;
}
Try the below code.
You can change the admin layout xml as like below., ie., app/code/Namespace/Modulename/view/adminhtml/layout/frontname_controller_action.xml
.
Add this code in the <block>
tag.
<arguments>
<argument name="rowUrl" xsi:type="array">
<item name="path" xsi:type="string"></item>
</argument>
</arguments>
My Ui-Component filename is tickets_listing.xml
<columns name="tickets_columns">
<!-- remove this section for disable grid click -->
<settings>
<childDefaults>
<param name="fieldAction" xsi:type="array">
<item name="provider" xsi:type="string">tickets_listing.tickets_listing.tickets_columns.actions</item>
<item name="target" xsi:type="string">applyAction</item>
<item name="params" xsi:type="array">
<item name="0" xsi:type="string">view</item><!-- Action FIle NAme -->
<item name="1" xsi:type="string">${ $.$data.rowIndex }</item>
</item>
</param>
</childDefaults>
</settings>
...............................................................................
...............................................................................
...............................................................................
And flush Magento cache and now it's disable.