PDA

View Full Version : display context menu based on roles



kamalakarreddy vancha
10 Sep 2014, 4:48 AM
Hi....
i created grid with context menu.
In grid i have the data like users, Roles
Ex: User Roles
User1 Manager
User2 Asst Manager
User3 Employee

In this i need give the permissions to the users based on their roles.
For that i am using context menu.
In context menu i created some common context menu.
In this i want display the context menu based on their roles.
For manager i want give some context menu, for employee i need display some other context menu like this......
How to do that...
Help me in this...
Provide any examples also....






Thanks in Advance
Kamalakar Reddy

StuartAshworth
11 Sep 2014, 11:50 PM
You can use the 'cellcontextmenu' event and interrogate the data of the record targeted and customise the context menu displayed based on that. Something along the lines of:






onCellContextMenu: function(grid, td, cellIndex, record, tr, rowIndex){


if(record.get('Role') === 'user'){
// show user menu
} else {
// show other menu
}


}