Click or drag to resize
AceoffixCtrlAddCustomMenuItem Method
Adds a menu item to custom menu.

Namespace: Aceoffix
Assembly: Aceoffix (in Aceoffix.dll) Version: 5.0.0.1
Syntax
public void AddCustomMenuItem(
	string Caption,
	string JsFunction,
	bool Enabled
)

Parameters

Caption
Type: SystemString
The caption of new menu item. If the caption is "-", means that this menu item is separator.
JsFunction
Type: SystemString
The name of JavaScript function. The JavaScript function will be called when user clicks this menu item.
Enabled
Type: SystemBoolean
true: Enable menu item. false: Disable menu item and menu item appears in grey.
Remarks
Call this method to add each menu item. The click event of new menu-item can be triggered by the specified JavaScript function.
Examples

The following code example shows how to use the AddCustomMenuItem method.

AceoffixCtrl1.CustomMenuCaption = "My &Tools";
AceoffixCtrl1.AddCustomMenuItem("&Show revisions", "OnCustomMenuClick()", true);
AceoffixCtrl1.AddCustomMenuItem("&Hide revisions", "OnCustomMenuClick()", true);
AceoffixCtrl1.AddCustomMenuItem("-", "", true);
AceoffixCtrl1.AddCustomMenuItem("&Accept all revisions", "DoAcceptAll()", false);

And then, you should define the JavaScript functions in the aspx file of current page.

JavaScript
<script language="javascript" type="text/javascript">
    function OnCustomMenuClick(iIndex, sCaption) {
        var AceoffixCtrl1 = document.getElementById("AceoffixCtrl1");
        if (iIndex == 0) AceoffixCtrl1.ShowRevisions = true;
        if (iIndex == 1) AceoffixCtrl1.ShowRevisions = false;
    }
    function DoAcceptAll() {
        document.getElementById("AceoffixCtrl1").AcceptAllRevisions();
    }
</script>
See Also