Created
May 27, 2020 15:41
-
-
Save skycrossman/33ebc4b2874ac4928f5ca6b62319ef4c to your computer and use it in GitHub Desktop.
Context Actions for TreeGridContainers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clientControlsFactory.createControl("Aras.Client.Controls.Public.TreeGridContainer", | |
{ | |
id: "control", | |
connectId: "grid", | |
}, | |
function(control) { | |
treeGrid = control; | |
// Set up events here | |
clientControlsFactory.on(treeGrid,{ | |
// Set up whatever other events you need | |
"gridMenuInit" : self.onGridMenuInit.bind(self), | |
}) | |
}); | |
/* Controls what options you have on the grid's right click context menu */ | |
onGridMenuInit(rowId){ | |
var ctxMenu = this.grid.getMenu(); | |
ctxMenu.removeAll(); | |
// For each context menu action you want to add, | |
ctxMenu.add(null, "Add", null, { | |
"onClick" : function(rowId) { | |
//Some code | |
} | |
}.bind(this), | |
// The icon you want to use. | |
icon: '../images/Part.svg' // <-- Most code is executed from the context of the '/Client/scripts/' folder, so this path is relative to that | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment