2

How do I disable grid click? So I can only click "Edit" link. enter image description here

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.

Keyur Shah
18.1k6 gold badges68 silver badges80 bronze badges
asked May 8, 2018 at 7:22

4 Answers 4

0

To remove row url on grid, you need to edit function getRowUrl in file Grid.php as below:

public function getRowUrl($row){
 return false;
}
answered May 8, 2018 at 7:26
1
  • 1
    I've tried changing the function in vendor/magento/module-catalog/Block/Adminhtml/Product/Grid.php to return false; but it didn't work. Commented May 8, 2018 at 7:31
0

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>
answered May 8, 2018 at 7:29
1
  • How can I override the file? I use the Ultimo theme Commented May 8, 2018 at 7:30
0

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.

answered Mar 27, 2020 at 6:10
0
<settings>
 <editorConfig>
 <param name="enabled" xsi:type="boolean">false</param>
 </editorConfig>
</settings>

This works for Magento 2.4

answered Mar 24, 2022 at 16:26

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.