我在Magento adminpanel中的模块具有与http://example.com/index.php/mymodule/一样的URL,并包含带有订单的自定义网格.我想在用户点击网格行时将用户重定向到标准的"订单视图"页面.
public function getRowUrl($row)
{
if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
return $this->getUrl('sales_order/view', array('order_id' => $row->getId()));
}
return false;
}
Run Code Online (Sandbox Code Playgroud)
但是这个URL指向http://example.com/index.php/sales_order/view/ ...而不是http://example.com/index.php/ admin/sales_order/view/...有什么建议吗?
UPD.config.xml:
<admin>
<routers>
<mymodule>
<use>admin</use>
<args>
<module>Foo_Mymodule</module>
<frontName>mymodule</frontName>
</args>
</mymodule>
</routers>
</admin>
Run Code Online (Sandbox Code Playgroud) 我可以从服务器端向Magento管理面板添加错误/成功消息,例如,
Mage::getSingleton(’core/session’)->addError('***');
Run Code Online (Sandbox Code Playgroud)
但是如何使用JS在客户端显示相同的消息?我的意思是标准方式(当然我可以创建相同的消息框,但它不是一个解决方案).例如,当我需要显示某些AJAX请求的状态时.有任何想法吗?