Extjs accordion layout - extjs

Accordion Layout is stacked panel layout in that only one panel is visible at time but i wanted to show two panel visible at time so can we do this with accordion panel??

You cannot extend the existing Accordion Layout class to achieve what you are looking for. If you go through the source code, you will notice that the Accordion layout is created by extending FitLayout. Now, I quote the property of FitLayout explained in documentation:
This is a base class for layouts that
contain a single item that
automatically expands to fill the
layout's container.
The documentation further says:
If the container has multiple panels,
only the first one will be displayed.
Now, what the questioner is asking for is to display two panels at the same time. Which is simply not possible with any layout extending from FitLayout.
Other Issues:
There are some design issues with the component the questioner is planning to implement;
What about of space will the currently displayed panels take?
How the accordion behavior will work? When user try to access the third panel.. how does the currently open panels behave.
Possible Solution:
Now, one possible solution is to the extend a Panel with vbox layout and have all the panels in it.

It is possible in Ext js 4.1 by using multi property of Accordion layout.
Check the docs here..

I'm sure you can't do it with the existing AccordionLayout.
You could write your own layout class to do it. It's not that hard, the AccordionLayout.js is only few pages long and most of it are comments.

Accordion layout is not designed for that. Choosing according layout for your requirement is like trying to fit sphere in a rectangle.
However, if you put a gun on my head, I quickly think about following options.
Extend existing Accordion class (Discard. Since base is not design for that)
Write your own magic Accordion (Apart from implementation, you have to answer Abdel Olakara mentioned issues, your self)
Mimic the desired behavior, by stacking up two or more Accordions (Well, not a great idea, but gun is on my head).

Related

Sencha GXT3 : Horizontal Layout Container with Scrolling

I use in my application sencha GXT 3 (Version 3.1.0). I want to display many items (widgets) horizontally. For this, I use HboxLayoutContainer. I have 14 widgets to display. The first 10 widgets are displayed correctly. The 4 widgets remaning are not displayed and the container display a dropdown button (Overflow case). With this button I can't see those 4 items. Can you help me to resolve this problem ?
The HBoxLayoutContainer is very specific on what is available in the overflow menu. It needs to know how to convert each item into a MenuItem. It'll have to be renderable and handle the appropriate select/click events.
What this means is that not every Widget added in the HBoxLayoutContainer is going to be compatible as an overflow MenuItem. For example, you wouldn't be able to (easily) convert a Grid into a single MenuItem; at least not in an abstract "widget library" way.
If you open up HBoxLayoutContainer and inspect the addWidgetToMenu, you'll get a better sense of which types are supported by default. From my copy (4.0.0 - but probably not too different from 3.x), I see:
SeparatorToolItem
SplitButton
TextButton
ButtonGroup
ToggleButton
All of which are GXT components.
Not all is lost though. Since the method is protected, it should be fairly straightforward to subclass and override this method to handle any Widget of your choice.

Responsive Vaadin Flow Grid

The grid is a nice table that fits well for wide screens like desktop or tablet. However, when showing on smaller mobile device the grid will not fit with more than a few columns. How did you solve this problem in your application?
The table stack pattern sounds promising: https://responsivedesign.is/patterns/data-table-stack/
But how could I implement this with Vaadin Flow? Is there a possibility to exchange the grid with an item list depending on the screen size?
A common approach is to have separate columns for mobile and desktop.
On mobile, or other narrow screens, there might only be one column in a stacking manner. This is quite simple to do with template renders, and a template along the lines of
<div>Name: [[item.name]]</div><div>E-mail: [[item.email]]</div>"
It's even possible to define the template as a Polymer template web component, import it, and set a template renderer like this
<mobile-column item="[[item]]"></mobile-column>
To toggle columns, one can add a resize listener (preferably throttled), e.g. as defined here.
The MediaQuery add-on is also very useful for this. I recommend toggling the visibility on the server, to avoid sending unnecessary data and doing unnecessary rendering in the browser.
I would go with media queries. There is an example here to include them in styles : Media queries in Shadow dom
So, for example, in case width is less than some pre-defined value, set visibility of grid to hidden and list to visible and vice versa, when needed.
Edit: there is also an add-on which might help in using queries : Mediaquery

MS PowerPoint CheckBox remains linked when slide is duplicated

Hoping you can help me as I have searched a lot of forums and did not find the same question, never mind the answer I need :)
I have a power point pack which I have put together. It is built to be a template for my team to use repeatedly and is set up using slide masters to control the layout. Each layout slide in the slide master includes two checkboxes to identify either a pass or a fail. My problem is that when you insert a new slide (by either duplicating an existing slide or adding a slide from the slide master layout), and change the checkbox value it also changes on the other slide. Is there a way either using some quick VBA or otherwise to stop this from happening and break the link between the two slides.
Any help would be really appreciated.
In a weird way, this is reasonable behavior from PowerPoint, though it certainly does seem bizarre.
Shapes on a master layout appear on any slide based on that layout. Though they appear on the slide, they're not editable on the slide; it's as though the slide were a clear layer above the layout, one that you can add more stuff to but that you can't "penetrate" to get at the stuff on the layout below.
Placeholders are a special case and so, apparently, are ActiveX controls like your checkboxes, which DO allow editing. So what's happening is that when you change a text box, you're changing the text box on the layout, not on the slide itself (the checkbox doesn't even exist on the slide ... you can't select and move it in normal view, for example, unless you go to the layout in Master view).
When you change the checkbox, you're changing the one on the layout, and since the checkboxes appear on any slide based on the layout, when you change the checkbox, you're changing the one on the layout, ALL of the slides based on that layout get the changed checkboxes.
Some mildly tricky VBA could look at each slide and if it's based on the layout that contains the checkboxes, COPY them to the current slide from the layout and finally make the checkboxes on the layout invisible.
The simpler solution might be to supply a sample slide with the checkboxes ON the slide and let the users copy/paste it into their presentations.
[later]
I've reported this to MS as not so much a bug as a design oversight; the behavior may make sense, but it's not useful and can mislead users (as you well know).
I'd suggest that you visit https://powerpoint.uservoice.com and suggest that ActiveX objects on masters/layouts behave more like placeholders ... spawn new instances of themselves when a new slide based on the layout is added rather than letting the user THINK that's what's happened.

CodenameOne - Dropdown List Design (FAQ Style)

Hi,
I am trying to achieve a similar screen to the one attached here using codename one. Its such that when a question is clicked, the answer drops down beneath it. The text would also have proper line breaks as it fills the screen width.
Is there any component I can use in achieving this using codename one?
I would suggest using the Tree component and setting the icons to null explicitly. This should work reasonably well for something like that and include the animation etc.

A better way to show different wpf pages in mainWindow?

I have several Wpf pages in my project, these pages have different forms and ui control indide theme. The image below shows the mainWindow and there are two button.
I want to show a specific page when I click on + or Edit button using the Frame control which is highlighted.
apparenatly this woks:
Page1 me = new Page1();
mainFrame.Content = me;
But it has an IE navigation sound and a toolbar appears after going to page2.
any better way to show diffrent pages and not using a frame?
You may want to convert the Page into a UserControl. You can then put that control inside some other container, such as a Grid. You'll have to manually swap out the pages in the container when navigating, but it looks like you're doing that anyway.
The purpose of the Frame control is to allow navigation. If you don't want navigation, then don't use Frame. You can turn off the navigation toolbar, but that won't actually disable navigation - there are mouse buttons and keyboard shortcuts for navigating back.
If you just want to host a UI element without navigation, use something simpler, like a Border element - put the content in its Child property. You can change the Child as many times as you like at runtime.
I was able to set the frame control's NavigationUIVisibility to Hidden. This solved the problem for me. I am using Visual Studio 2010 though so it might not be applicable to older VS versions.
Ian Griffiths, what you suggest increases the workload on the developer substantially. And you are stepping outside of the underlying paradigm of XAML.
In my case I'm developing a game application and have chosen WPF as the UI platform as much as possible. For me that means a intro screen, character select, etc. The purpose of Pages is to encapsulate the navigational need of such an application.
I suspect your downvote is due to your statement "If you don't want navigation...". Upon re-reading the original posters question I see he does want navigation, he just wants it on his own terms. I would have voted you down too. YotaXP's solution neglects the issues with using a User Control, particularly if it may contain other User Controls. It looks like Chris Calvert came up with an actual solution to the poster's issue within the parameters of the problem.
I would be curios if I could override the navigation hotkeys and such within the existing paragimn but that's properly in its own thread.

Resources