我正在尝试在 ExtReact 中实现最大化工具按钮,但我得到了一个
error: "Uncaught TypeError: n.up is not a function".
这是我当前对该功能的实现:
{
type: 'maximize',
handler: function(e, target, panelHdr) {
var panel = panelHdr.up('panel');
if (!panel.maximized) {
panel.restoreSize = panel.getSize();
panel.restorePos = panel.getPosition(true);
panel.maximized = true;
var parent = panel.ownerCt,
container = parent ? parent.getTargetEl() : panel.container,
newBox = container.getViewSize(false);
panel.setBox(newBox);
} else {
var newBox = panel.restoreSize;
newBox.x = panel.restorePos[0];
newBox.y = panel.restorePos[1];
panel.maximized = false;
panel.setBox(newBox);
}
}
}