1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    66
    Vote Rating
    0
    salmondavid888 is on a distinguished road

      0  

    Default How to stop expanding accordion? I mean how to cancel expand event?

    How to stop expanding accordion? I mean how to cancel expand event?


    I am using ExtGwt. i have below code.

    private ContentPanel mainPanel = new ContentPanel();
    private ContentPanel firstAccordion = new ContentPanel();
    private ContentPanel secondAccordion = new ContentPanel();
    private ContentPanel thirdAccordion = new ContentPanel();
    i have accordionlayout set. i have 3 accordions. all are added to mainPanel. when user is viewing secondAccordion, if user clicks on first accordion then first accordion should not be expanded. user should be retained in seconAccordion itself. so, my question is, i have certain condition when to retain the user in the same accordion where he is. if user clicks on any other accordions, then i should stop expandint the other accordion. how can i do that? Please help me.

    Thanks!

  2. #2
    Sencha User WesleyMoy's Avatar
    Join Date
    Oct 2009
    Location
    Redwood City, California
    Posts
    402
    Vote Rating
    2
    WesleyMoy is on a distinguished road

      0  

    Default


    You can subclass AccordionPanel and override onBeforeExpand. You can tell which content panel is active by checking which one is expanded. You can tell which content panel the user has tried to select with ComponentEvent.getComponent.

    If you don't call super.onBeforeExpand in turn, you will prevent changing which content panel is active.

    Here's a quick example with an anonymous inner class subclassing AccordionLayout.

    Code:
    new AccordionLayout() {
    
     @Override
     protected void onBeforeExpand(ComponentEvent ce) {
       if (ce.getComponent() != firstAccordion) {
         super.onBeforeExpand(ce);
       }
     }
    
    });
    You can substitute the if-condition with any other logic you like, including checking for the currently active panel.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar