1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    2
    Vote Rating
    0
    centerfortheone is on a distinguished road

      0  

    Default Newbie Question > Render Panel only if condition is true

    Newbie Question > Render Panel only if condition is true


    Hi Everyone,

    I am new to EXT JS...and the architect program. I was wondering if any of you could guide me as to how to add conditions to the rendering of panels. I want to render certain panels on my page ONLY if the users access level is high enough.

    Where would I enter this code?.....I don't need code written to me...just some help on where to place it inside the architect.....?

    I looked at the "before render" event ....but I don't know how to cancel the rendering of the panel ... is that a possibe approach or is there a better one?

    Thank you everyone

  2. #2
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    512
    Vote Rating
    41
    BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about

      0  

    Default


    set your panel to hidden in architect. after you retrieve your 'access level' values, find your panel by issuing a blanket search Ext.Viewport.down('#panelsItemID').setHidden(false); if you want to show it else leave it alone as it's already hidden.

    That's big picture, your approach would differ depending on when and where you actually add that panel to your app.

    Hope that helps
    John

Thread Participants: 1

Tags for this Thread