Skip to content

Instantly share code, notes, and snippets.

@skycrossman
Created May 27, 2020 15:41
Show Gist options
  • Save skycrossman/33ebc4b2874ac4928f5ca6b62319ef4c to your computer and use it in GitHub Desktop.
Save skycrossman/33ebc4b2874ac4928f5ca6b62319ef4c to your computer and use it in GitHub Desktop.
Context Actions for TreeGridContainers
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