1. #1
    Sencha User
    Join Date
    May 2013
    Posts
    53
    Vote Rating
    1
    kamalakarreddy vancha is on a distinguished road

      0  

    Default Unanswered: display context menu based on roles

    Unanswered: display context menu based on roles


    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

  2. #2
    Sencha Premium Member
    Join Date
    Feb 2009
    Location
    Glasgow, Scotland
    Posts
    328
    Answers
    10
    Vote Rating
    12
    Stuart-SwarmOnline will become famous soon enough Stuart-SwarmOnline will become famous soon enough

      1  

    Default


    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:


    Code:
    
    onCellContextMenu: function(grid, td, cellIndex, record, tr, rowIndex){
    
    
        if(record.get('Role') === 'user'){
            // show user menu
        } else {
            // show other menu
        }
    
    
    }

Thread Participants: 1

Tags for this Thread