コード例 #1
0
ファイル: Action.php プロジェクト: Doability/magento2dev
    protected function _prepareLayout()
    {
        $this->js->add(<<<JS
    window.M2eProVarienGridAction = {
        execute: function (select, id) {
            if(!select.value || !select.value.isJSON()) {
                return;
            }

            var config = select.value.evalJSON();
            if (config.onclick_action) {
                var method = config.onclick_action + '(';
                if (id) {
                    method = method + id;
                }
                method = method + ')';
                eval(method);

                select.value = '';
            } else {
                varienGridAction.execute(select);
            }
        }
    };
JS
);
        return parent::_prepareLayout();
    }