首先匯出設定檔:系統設定-->自訂-->匯出自訂項 匯出ISV配置(ISV.CONFIG)
<?xml version="1.0" encoding="utf-8"?><IsvConfig> <configuration version="3.0.0000.0"> <Entities> <!--對應的實體 name-實體名 --> <Entity name="account"> <!-- 菜單 --> <MenuBar> <!-- Custom Menus that you may add --> </MenuBar> <!-- 工具列節 --> <!-- ValidForCreate-建立時有效 ValidForUpdate-更新時有效 --> <ToolBar ValidForCreate="0" ValidForUpdate="1"> <!-- 按鈕節 --> <!-- Icon-按鈕表徵圖 PassParams-是否傳遞系統預設的幾個參數(typename,type,id,orgname,userlcid,orglcid) --> <!-- WinMode-新視窗模式(0-window 1-Modal Dialog 2-Modeless Dialog)JavaScript-要執行的指令碼,一般為方法名 --> <!-- WinParams-特殊參數 具體用法還沒研究 Url-開啟的頁面,一般和JavaScript參數選其一 --> <Button Icon="/_imgs/ico_18_debug.gif" PassParams="1" WinParams="" WinMode="0" Url="" JavaScript="UpToHeadcompany();"> <Titles> <Title LCID="2052" Text="我的按鈕" /> </Titles> <ToolTips> <ToolTip LCID="2052" Text="我的按鈕" /> </ToolTips> </Button> </ToolBar> <!-- 左側導航 --> <NavBar> <NavBarItem Icon="/_imgs/ico_16_4.gif" Url="about:blank" Id="navItem"> <Titles> <Title LCID="1033" Text="我的菜單" /> </Titles> </NavBarItem> </NavBar> <!-- 列表頁相關 --> <Grid> <!-- 功能表列 --> <MenuBar> <Buttons> <Button Icon="/_imgs/Tools/ico_contract_template.gif" JavaScript="alert(1);"> <Titles> <Title LCID="1033" Text="我的菜單" /> </Titles> <ToolTips> <ToolTip LCID="1033" Text="我的菜單" /> </ToolTips> </Button> </Buttons> </MenuBar> </Grid> </Entity> </Entities> </configuration>
按鈕的事件也可以表單的onload事件中動態綁定
for (var index in document.getElementsByTagName("LI")) { if (document.getElementsByTagName("LI")[index].title == "我的按鈕") { document.getElementsByTagName("LI")[index].onclick = MyEvent; break; }}
儲存檔案,再匯入自訂實體即可(系統設定--〉自訂--〉匯入自訂項,瀏覽--〉上傳--〉匯入所選自訂項)
重新整理頁面即可看到效果