1

I added new action in row at admin grid. It works, link oppening in new window. But when I click on link, checkbox meking (on or off enter link description here) How can i remove event from row? How can I make checkbox clickable only when i click on it? I added action on Associated product in grouped product type.

7
  • Can you please explain a bit more ? what even do you want to remove Nov 6, 2015 at 10:52
  • have you added action in related products or up-sells or cross-sells grid?
    – Abdul
    Nov 6, 2015 at 10:58
  • you have to add row url to edit public function getRowUrl($row) { return $this->getUrl('*/*/edit', array('id' => $row->getId())); } Nov 6, 2015 at 11:13
  • @Qaisar Satti Thanks, I tried it, but checkbox meking (on or off)
    – omelandr
    Nov 6, 2015 at 11:22
  • @Abdult Associated product in grouped product type
    – omelandr
    Nov 6, 2015 at 11:23

2 Answers 2

1

Need to change code in grid.js (magento\js\mage\adminhtml\grid.js)

Replace code from

 rowMouseClick : function(event){
    var element = Event.findElement(event, 'table');
    if(this.rowClickCallback){
          try{
              this.rowClickCallback(this, event);
          }
          catch(e){}
      } 
      varienGlobalEvents.fireEvent('gridRowClick', event);
  }

TO

rowMouseClick : function(event){
    var element = Event.findElement(event, 'table');
    if(element.id!='super_product_grid') {
        if(this.rowClickCallback){
            try{
                this.rowClickCallback(this, event);
            }
            catch(e){}
        }   
    }
    varienGlobalEvents.fireEvent('gridRowClick', event);
}

Note : Please replace your gird id in code. Currently i have added "super_product_grid" in code

0

In your Grid.php define this method empty

public function getRowUrl($row) {
}

You may also need to create a custom renderer: http://inchoo.net/magento/how-to-add-custom-renderer-for-a-custom-column-in-magento-grid/

* EDIT *

try in the grid class (that overrides a core grid Mage_Adminhtml_Block_Catalog_Product_Grid), and return some fake JavaScript function, like this:

public function getRowClickCallback()
{
    return 'fakeJsFunction';
}
4
  • I tried it, but checkbox meking (on/off)
    – omelandr
    Nov 6, 2015 at 11:30
  • Updated answer.
    – B00MER
    Nov 6, 2015 at 11:35
  • I tried to create custom renderer, but have the same problem
    – omelandr
    Nov 6, 2015 at 12:49
  • Updated answer again. Reference: magento.stackexchange.com/a/73324/69
    – B00MER
    Nov 6, 2015 at 22:38

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.