List with multiple items that contain multiple boxes Sencha Touch 2.3 - extjs

I have a list in my app that I'm creating with Sencha-Touch 2.3. Imagine a single list item that has multiple pieces of data equally spaced apart horizontally. There can be many list items like this. The size in between the boxes that are in each list item change depending on the device, because their size is a percentage of the devices width. What I described here is what I want to happen.
Right now I'm using an itemTpl with span elements. I gave the span elements a class so that I can reference it in css. The css changes I make to width do not make any difference to these span elements in each list item. The span elements all touch, with no space in between them no matter what I do.
How can I make what I described here happen? I've been searching the internet for an answer for a long time but haven't found anything.

Have you tried looking at the Ext.dataview.DataView with useComponents:true?
You can define a DataItem with a layout of hbox and use multiple sub-components with flex:1 to get a bunch of horizontal boxes with all equal width.
check out the docs here to get a sense of how to implement a DataItem inside of a DataView

Related

WPF WrapPanel, but fills empty space due to different size items?

I have a list of "Group" objects, each of which contains a list of "Option" objects, that show up as checkboxes. I want these to be displayed in a condensed fashion automatically without me having to layout the UI manually with something such as a Grid (which is what I've done in the past, and takes a lot of effort).
My groups have varying numbers of options, so the size of the container for the group is not the same across groups. I'm using a WrapPanel, but it leads to a fairly ugly design because each item in the WrapPanel appears to be slotted into the same size container:
I know I've done this in HTML/CSS/JS, where I can have it automatically condense the unused space. Is there something like this for WPF? My list of options is manually created, but I can add/remove options fairly easily in my code, so I would rather not have to manually recalculate things in a grid view.
I've looked at Is there any way to occupy blank space in WrapPanel automatically?, which sounds similar, but the answer to that question does not have an example and I could not figure out what I was actually supposed to change/use in the answer (my attempts using it did not make any difference at all to layout).
I guess you use Horizontal Orientation of WrapPanel, so every row have height as the maximum its element. Your problem isn't free space in the ends of rows, so the solution that you mentioned doesn't work for you. You can try to use Vertical orientation of WrapPanel, your wrappanel' elements look like they have similar width, possible it would look better.

Multiline toolbar Ext JS 4.2

Is there a standardized way to create a multiline toolbar? I'm dinamically loading the items and they are usually more than enough to make the toolbar overflow. But I don't want the overflow functionality, I just want the items to span several lines. As the items are loaded dinamically, I can not create several stacked toolbars beforehand. An observation: I switched the layout from the implicit default 'hbox' to 'auto' and the items do span several lines, but then, features like separators have undesired collateral efects, like having only one item or separator on each line, and also different looks in different browsers.
I could dinamically calculate the suposed total width of the items and divide by the max desired width of a toolbar to obtain the number of toolbars I need, but I don't know exactly at what point the items get a valid useful width.
This is an old question posted by someone else sometime ago. I'm re-asking because perhaps with the latests releases of Ext JS, they shiped 'undocumentedly' the sooo needed layout solution for this issue.
Thanks!
I don't think there is an out of box component that can do all of the things you want.
The default toolbar layout of HBox just places everything horizontally spaced.
If you know that you need more space you can always put in a container with whatever layout you want for it's items. You can get creative and nest all kinds of layouts.
Personally I think this would end up looking ugly. Perhaps there is a better solution with an alternative approach to your design needs.

How to resize a responsive list from three columns to one (using responsivegridsystem.com)

I am using www.responsivegridsystem.com for my columns and here is what I've come up with: ux.stoicdigital.com/#intro-message.
I'd like the list to work like this one: http://doyouimpress.com/#uses-list
The biggest problems are that, above a certain amount of px (can't remember exact), the three column grid is centered, but doesn't LOOK centered due to cell widths, etc. and that below that amount of px (when list is in one-column mode), the off-center problem is even worse.
Again, I realize that this has to do with cell widths, etc. but I can't figure out where to make the changes I need to do the following at both sizes:
Align text and bullets left
Center the list itself on the page
Any advice would be appreciated. Would especially appreciate any details you can give re: changes to make to CSS.
PS: If there is another way to achieve this outside of Responsive Grid System, I'm open to that too.
The text doesn't look centered because it isn't. The container div is centered, but since you align the text to the left its all scewed to the left, just like it'd be scewed to the right if you aligned the text to the right.
You could align the text to the middle, but then your checkbox icons wouldn't be lined up. If you want the text to be centered but still have the icons lined up you need to attach the icons so something else but the text. You could display them as pseudo-elements to the <li>, but the drawback is that there would be varying amounts of space between the text and the icons.
What I'm coming at is basically that you can't center the columns this way (as long as you don't make sure that the text in each <li> is equally wide) - however you can fake it and that's what they do on that site you're referring to.
To fake it, simply give each column div a unique class name (or target them with :nth-child), then move each column manually to make it look like the content is centered. You could give them different width-values (this is what they do in your example), different padding-values or similar. That's entirely up to you.
As for the one-column layout, do something similar where you add a padding-value to push them closer to the center, but obviously use the same value for all column divs.

Is there an alternative to a WPF WrapPanel that wraps after a certain number of items, not a height?

Normally a WPF WrapPanel (Orientation="Vertical") will stack items vertically (and grow vertically) until it runs out of space from the parent container, and then it will "wrap" to the next column.
I want this functionality, but I want to add a hard limit to the number of items in a column. For instance, if my height is 100 and I have 3 items that are 30 pixels high, normally it could fit them all without wrapping. However, say I want to force it to wrap after 2. In that case, I want it to only grow to a height of 60, and wrap the 3rd item into the second column.
Is there something I can do to make this happen?
Maybe you can do it with the UniformGrid.
Use the Rows property to definie the amount of elements in vertical direction.
here is a nice little article about the available layout panels in WPF. If one of these does not fit the bill, you might have to build your own custom panel, here is a decent demo.

WPF What container should i use

well what i want is this lets say i have a "panel" with the width 100 and height 100
now i want to place X objects witht the size 20 so when i add more 5 items it should have all items on one line
|Item1|Item2|Item3|Item4|Item5|
now if i would add one more then i want it to split it to 2 lines with 3 items on each row
|Item1|Item2|Item3|
|Item4|Item5|Item6|
and well i guess you get the point, iv tryed stack panel but i cant get it to work the way i want it to..
Edit:
well it doesnt matter that mutch if each row has an equal amount of items.. so a wrapPanel should do the job next problem -> Here
There's no standard WPF panel that will do this for you. The WrapPanel comes close, but it will not make sure that your rows are even. Your best bet is to implement your own panel. Here's a good example on codeproject
The WrapPanel should suit your needs:
Controls are positioned in either a
stack or row based on the Orientation
property. In addition to stacking, the
WrapPanel provides wrapping support
for contained controls. Thus if more
controls are added to a WrapPanel than
can be displayed by the width of the
WrapPanel, they are wrapped around to
form an additional stack or row.
To be honest, I haven't tried that specific requirement myself.
I guess you could use WrapPanel... but then you would get 2 lines, (5 items and 1 item)..
What would happen if you had, say.. 7 items?
I don't think you will be able to get a container control that does that automatically. You could have a Grid with two rows and a StackPanel in each row. As you add the items you would need to programmatically select which StackPanel to put each item into.

Resources