I am trying to implement a maximize tool button in ExtReact but I get an
error: "Uncaught TypeError: n.up is not a function".
Here is my current implementation of this 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);
}
}
}