Results 1 to 2 of 2

Thread: display context menu based on roles

  1. #1
    Sencha User
    Join Date
    May 2013
    Vote Rating

    Default Unanswered: display context menu based on roles

    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 StuartAshworth's Avatar
    Join Date
    Feb 2009
    Glasgow, Scotland
    Vote Rating


    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
    Want to build better Sencha apps? Check out my free email course Best Practices for Improving your Sencha Apps

    Learn Ext JS 6 with my new ebook - Ext JS 6: Getting Started. Get a Sample Chapter now!

    Need help with Sencha development, code reviews or training? Get in touch!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts