1

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.

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;
}
| improve this answer | |
  • 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. – VirtusO May 8 '18 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>
| improve this answer | |
  • How can I override the file? I use the Ultimo theme – VirtusO May 8 '18 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.

| improve this answer | |

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.