Warning: Cannot modify header information - headers already sent by (output started at /www/wwwroot/sbboke.com/wp-content/plugins/wordpress-seo/src/integrations/front-end-integration.php:409) in /www/wwwroot/sbboke.com/wp-content/themes/pacify/content-single.php on line 5

magento如何使管理网格行无法点击

我在网格中使用selectbox形成网格。所以我想让行无法点击,因为当我尝试点击选择框时它也会触发复选框。

这就是我实现这一目标的方式。

这是我的网格构造函数,代码如下所示。它将在selectbox click上停止onrowclick事件

public function __construct()
{
    parent::__construct();
    $this->setId('customerGrid');
    $this->setUseAjax(true); // Using ajax grid is important
    $this->setDefaultSort('id');
    $this->setDefaultFilter(array('customer_ids'=>1)); // By default we have added a filter for the rows, that in_products value to be 1
    $this->setSaveParametersInSession(false);  //Dont save paramters in session or else it creates problems
    $this->setAdditionalJavaScript("
    // added click on selectbox support
    serializerController.prototype.rowClick = serializerController.prototype.rowClick.wrap(function(o, grid, event) {
        var tagName = Event.element(event).tagName
            isSelect = (tagName == 'SELECT' || tagName == 'OPTION');
        if (!isSelect) {
            o(grid, event);
        }
    });
    ");
}

相关文章

0 0 投票数
文章评分
订阅评论
提醒
0 评论
内联反馈
查看所有评论