我添加了一个新的未绑定字段以在“交易明细”选项卡中显示库存项目的图像,然后设置图像的固定高度,我添加了一些javascript,但是在添加javascript之后,屏幕上没有填充任何默认值,例如RefNbr和Date,下面是正在使用的javascript代码。相同的javascript代码正在我的自定义屏幕上运行。
<px:PXJavaScript runat="server" ID="CstJavaScript1" Script="var css = '.GridRow > img { width: 100%; height: 40px; }', head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } head.appendChild(style);" />
答案 0 :(得分:0)
之前我已经在选项卡项中添加了Javascript,但是现在当它正常工作时,我移出了选项卡。
</px:PXTab>
<px:PXJavaScript runat="server" ID="CstJavaScript1" Script="var css = '.GridRow > img { width: 100%; height: 40px; }', head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } head.appendChild(style);" />