Override expand/collapse animation in panel/grid with EXTJS - extjs

Normally, the expand/collapse functionality in extjs works as the panel/grid header stays in a position and the body of the panel/grid moves down/up. But I need the panel header to be in a position and on expand, the header has to move up showing the panel/grid body. On collapse, the header has to move down and come to the original position. This is just like expand and collapse in accordian layout inner panel. But I want it with a single panel. Any code samples or pointer would be very helpful.
Note: Please note that I cannot use any third party plugin..

This sample in ExtJs 4.2.1.
One way to do what you are trying to achieve is by injecting "expander" div in afterrender event of parent panel before collapsible children. This means items are at the bottom of parent body after expander div so there is space to expand them up. When children are collapsed/expanded or parent is resized, injected div gets height of parent minus children.
You can see it here: https://fiddle.sencha.com/#fiddle/44c
Edit: I don't really get 1 panel part - if you want single panel to behave like that, expander could be injected into wrapper before header and content, but than you are left with panel of same size but collapsed - the only scenario this makes sense to me is by reversing collapse of children in sample I provided

Related

How to set scrollbar at the bottom by default?

I have template message in image.
Can you help me set scrollbar at the bottom by default?
Use scrollIntoView() on the element you wish to display at the bottom. For example, for the last message of a chat you want to show :
elementMessage.scrollIntoView(true);
It will make the parent element scroll until your element is visible (here with the optional parameter alignToTop set to true, the element will be aligned at the top of the scrollable parent, or as high as possible if it's your last element).
The Javascript code below should keep your div's scrollbar positioned at the bottom like you described:
let objDiv = document.getElementById("divExample");
objDiv.scrollTop = objDiv.scrollHeight;
link below: Link here

How to make extjs accordion vertically scrollable

fiddle here.
If there are many panels in the accordion they vertically just start bumping up against each other and can't be expanded. I would like to make the total height of the accordion the height of the headers plus the height of one panel body (expanded). And then the parent panel should just have a scrollbar to show that amount of height. This way there is always an open accordion and you can scroll down to any header and instead open that one.
Is this not possible?
If I turn the layout of GroupListView to vbox intead of accordion I then get what I want but unfortunately when you expand/collapse the panels, the animations are all messed up (doesn't work like the accordion)
In ExtJS 5.1.1, setting fill: false on the layout declaration seems to produce the desired result.

extjs 4 scroilling WITHOUT a scrollbar

I have this narrow panel which is basically a list of thumbnails, and i need to be able to scroll over them using buttons.
We have a panel (anchor layout), with containers in it, and each container contains the image.
there isn't space for a scrollbar, and anyway we don't want one.
I thought it would be as easy as in the listener for my button calling panel.getEL().scroll('b',20)
but this isn't working because the scrollHeight === ClientHeight so scroll does nothing.
Is there a technique I am missing or should this work?
So you're using a button to scroll through the images? What about having the button's listener remove/hide the containers/images at the front of the panel to allow the others to use the space?

In ExtJS, how can I create a panel and have it hover above a TabPanel?

I have a viewport with a tab panel in it. I'm trying to create a standard panel dynamically and make it visible. I'm able to create the panel and isVisible() returns true after calling doLayout on the viewport but the panel is not visible on the screen. Is there any way to make it visible (i.e., to hover above the tab panel)?
If you create the panel as a child of the document body and position it absolutely it should show above your existing layout. You could also (more easily) use an Ext.Window to do this.

How to bring a menu to front of a navigation frame in silverlight?

I Have a Silverlight page with a header menu, a navigation frame, and a footer. In my header menu I want to put a drop down menu, but when I open the menu, it goes behind the frame.
Is there a way to put it forward? Canvas.ZIndex makes no difference at all.
For me to get this to work, the navigation frame had to be in a grid that was a child of the grid my menu was in.
Like so:
Grid "FullPageGrid"
Grid
Menu Stuff
Grid
Navigation Frame
Not sure why that works, but it does.
You can use this free opensource menu for this purpose:
www.sl4popupmenu.codeplex.com
It brings the content on top by placing in a Popup control.
If you can place the drop down menu later in the XAML, it will appear above.
So you want to have this hierarchy:
Grid
Grid
Your navigation frame
Grid
The menu

Resources