1

How do I disable grid click? So I can only click "Edit" link.

This is the grid in adminhtml: enter image description here

Here are all the places where getRowUrl($row) function is:

enter image description here

I've tried changing the function in vendor/magento/module-catalog/Block/Adminhtml/Product/Grid.phpto return false;, and afterwards recompiling/deploy static content, but it doesn't work:

enter image description here

2

Check this path

vendor\magento\module-catalog\Block\Adminhtml\Product\Grid.php

you need to override this file and update below function as:

public function getRowUrl($row)
    {
        return "javascript:void(0)";
    }

OR
public function getRowUrl($row)
    {
        return false;
    }

Hope this helps!

  • 1
    Hmm, I tried this already, in vendor/magento/module-catalog/Block/Adminhtml/Product/Grid.php on line 439. I also ran setup:di:compile. Here is a picture of all the places where there is a getRowUrl function: imgur.com/a/fiXDoih – VirtusO Apr 30 '18 at 10:00
  • 1
    Also, if I want to override the file, where should I copy the file to? Thanks – VirtusO Apr 30 '18 at 10:10
  • Please, do you know how? – VirtusO May 7 '18 at 8:39

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.