Results 1 to 2 of 2

Thread: [ExtJS4] MVC Show/hide permission-based components

  1. #1
    Sencha Premium Member
    Join Date
    Apr 2013
    Posts
    10
    Answers
    1

    Question [ExtJS4] MVC Show/hide permission-based components

    Hello, how are you guys?


    I'm working on a MVC project where we need to hide (not just disable) certain elements such as menu, button, textfield, etc based on the user Roles.
    I already have a controller that tells me if the current user is or not allowed to use these special components, but I can't find where in the whole MVC structure is the better place to control what to display or not when the system loads.

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    I normally use initComponent to only provide the items that the user has permission for instead of hiding/showing them.

    Code:
    initComponent : function() {
        this.items = [...]; //some means to provide an array
    
        this.callParent();
    }
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

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
  •