我们通过图形扩展向销售订单页面添加了一个按钮。当我们单击这个新按钮(基于选定的详细信息行)时,我们调用 PXPopupRedirectException 调用另一个图形来表示弹出面板。我们遇到的问题是默认大小非常小。如果可能的话,我们希望弹出面板/图表的宽度为父页面的 100%。
我们按钮中的调用使用这个...
throw new PXPopupRedirectException(graph, string.Empty, true);
从下面的屏幕截图中您可以看到面板打开的程度有多小。默认情况下,我们可以做什么来让面板自动适应父区域的完整尺寸,如红框中所示?如果我们将图表作为标准的新选项卡/页面打开,那么它看起来不错。
这是当前的默认修复:您可以使用图表在屏幕后面的代码中设置弹出窗口的大小:
public partial class Page_CR301000 : PX.Web.UI.PXPage
{
protected void Page_Init(object sender, EventArgs e)
{
Master.PopupHeight = 700;
Master.PopupWidth = 900;
}
}
不幸的是,无法使用此方法将尺寸设置为父屏幕宽度的百分比。
您能描述一下您的场景和详细要求吗? 我们也许可以为弹出窗口提供更多的灵活性。 谢谢!
我可以使用图形扩展设置弹出窗口大小,如下所示:
public override void Initialize()
{
base.Initialize();
Page page = HttpContext.Current?.Handler as PXPage;
if (page != null)
{
page.Load += Page_Load;
}
}
private void Page_Load(object sender, EventArgs e)
{
Page page = (Page)sender;
//cant set the Popup height/width on the Master - as it is read only
// need to cast as BaseMasterPage
BaseMasterPage baseMasterPage = (BaseMasterPage)page.Master;
baseMasterPage.PopupHeight = 1000;
baseMasterPage.PopupWidth = 1800;
}