自定义菜单示例

    技术2025-11-12  10

     <Entity name="new_customerorderline"> <ToolBar ValidForCreate="0" ValidForUpdate="1"> <Button Icon="/_imgs/ico_18_debug.gif" JavaScript="crmForm.Save();&#xA;if(crmForm.IsDirty==true )&#xA;{alert('系统须自动保存表单信息,请再次点击同步按钮!');} &#xA;else&#xA;{ &#xA; if(confirm('系统将把此条记录同步到IFS,是否确定?')) &#xA; {&#xA; var url='/ISV/SynBasicData/Default.aspx'; &#xA; var sParams=''; &#xA; var ID=crmForm.ObjectId;&#xA; var EntityName=crmForm.ObjectTypeName;&#xA; sParams=addURLParam(sParams,'Id',ID);&#xA; sParams=addURLParam(sParams,'EntityName',EntityName);&#xA; sendRequest(url,sParams);&#xA; }&#xA; }&#xA; function sendRequest(url, sParams)&#xA; {&#xA; var xhttp = new ActiveXObject('Microsoft.XMLHTTP');&#xA; xhttp.open('POST',url,false);&#xA; xhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); &#xA; xhttp.send(sParams);&#xA; var doc = xhttp.responseText;&#xA; if(xhttp.status == 200)&#xA; {&#xA; alert(doc);&#xA; }&#xA; else if(xhttp.status == 500)&#xA; {&#xA; alert('Ajax 500错误!');&#xA; alert(doc);&#xA; }&#xA; else&#xA; {&#xA; alert(xhttp.status);&#xA; }&#xA; }&#xA; function addURLParam(sParams, sName, sValue) &#xA; {&#xA; if(sParams.length &gt; 0) &#xA; {&#xA; sParams += '&amp;'; &#xA; }&#xA; return sParams+encodeURIComponent(sName) + '=' +encodeURIComponent(sValue); &#xA; }"> <Titles> <Title LCID="1033" Text="提交" /> </Titles> <ToolTips> <ToolTip LCID="1033" Text="提交费用申请单" /> </ToolTips> </Button> <Button Icon="/_imgs/ico_18_debug.gif" JavaScript=""> <Titles> <Title LCID="1033" Text="同意" /> </Titles> <ToolTips> <ToolTip LCID="1033" Text="通过费用申请" /> </ToolTips> </Button> <Button Icon="/_imgs/ico_18_debug.gif" JavaScript=""> <Titles> <Title LCID="1033" Text="拒绝" /> </Titles> <ToolTips> <ToolTip LCID="1033" Text="拒绝费用申请" /> </ToolTips> </Button> </ToolBar> <Grid> <MenuBar> <Buttons> <ToolBarSpacer /> <!--<Button Icon="/_imgs/ico_18_debug.gif" JavaScript="var RoleXml=GetCurrentUserRoles(); var IsAd = UserIsHasRole('下单员',RoleXml);if(!IsAd){alert('您不是下单员,没有权限操作!');return;}else{var sUrl=prependOrgName('/isv/Convert/ConvertPIToOrder.aspx'); var oArgs=getSelected('crmGrid'); openIsvWin(sUrl,true,'2','',oArgs);} " WinParams="1" PassParams="1" WinMode="2">--> <Button Icon="/_imgs/ico_18_debug.gif" JavaScript="var RoleXml=GetCurrentUserRoles(); var IsAd = UserIsHasRole('下单员',RoleXml); if(!IsAd){alert('您不是下单员,没有权限操作!');}else{var sUrl=prependOrgName('/isv/Convert/ConvertPIToOrder.aspx'); var oArgs=getSelected('crmGrid'); openIsvWin(sUrl,true,'2','',oArgs);}" WinParams="1" PassParams="1" WinMode="2"> <Titles> <Title LCID="2052" Text="转订单" /> <Title LCID="1033" Text="Convert" /> </Titles> <ToolTips> <ToolTip LCID="2052" Text="转订单" /> <ToolTip LCID="1033" Text="Convert" /> </ToolTips> </Button> <Button Icon="/_imgs/ico_16_changestatus.gif" JavaScript="var RoleXml=GetCurrentUserRoles(); var IsAd = UserIsHasRole('下单员',RoleXml); if(!IsAd){alert('您不是下单员,没有权限操作!');}else{var sUrl=('/isv/ConfigLogo/ConfigLogoPage.aspx?rel_no=1'); var oArgs=getSelected('crmGrid'); openIsvWin(sUrl,true,'2','dialogHeight:600px;dialogWidth:1080px;center:yes;scrollbars=yes;resizable=1;maximize:yes;minimize:yes;',oArgs);}" WinParams="1" PassParams="1" WinMode="1"> <Titles> <Title LCID="2052" Text="配置Logo" /> <Title LCID="1033" Text="Configure Logo" /> </Titles> <ToolTips> <ToolTip LCID="2052" Text="配置Logo" /> <ToolTip LCID="1033" Text="Configure Logo" /> </ToolTips> </Button> </Buttons> </MenuBar> </Grid> </Entity>

    1、ToolBar 中Button相关效果

     

     2、  MenuBar  中的Buttons相关效果

    最新回复(0)