Create a horizontal listview in winJs? - microsoft-metro

I have implemented a ListView and it seems vertical in orientation.
Cannot change the orientation to horizontal. I know it is easy in WinRT and Xaml but I have no idea in WinJS. Any property or method I need to set ? Please let me know.

There's no template edition like in xaml c# for list view . I guess the only way is to use a Grid layout and change the height as to hold only one element at a time . As a result it will get on expanding to the right with a fixed height.
<div id="basicListView"
data-win-control="WinJS.UI.ListView"
data-win-options="{ itemDataSource : DataExample.itemList.dataSource,
itemTemplate: select('#mediumListIconTextTemplate'),
layout: {type: WinJS.UI.GridLayout}}">
</div>
Specify your own height and width in cssto hold one item only

It appears that at there are many properties supported at 8.1 that aren't supported at 8.
GridLayout Orientation being one of those.
Minimum supported client : Windows 8.1 Preview [Windows Store apps only]
Easiest means that I've come across is here:

Related

Is it possible to center a control(GenericTile) in the middle of the screen in View.xml without using css?

im new to ui5 so i apologize if my question is too easy. i have a Generatic Tile that supposed to display events from Odata v4. the problem i have is that this tile is required to be in the middle of the screen(knowing that there is nothing else around). i tried using FlexBox(and many other classes) and i was only able to center it, but not to get it in the middle of the screen. is it possible to do it using only my View.xml?
enter image description here
Maybe try to wrap your Tile with a VerticalLayout or VBox (which extends FlexBox) and set height='100%' justifyContent ='Center'
Something like:
How to vertically center align my form container in openui5
or this:
https://sapui5.hana.ondemand.com/sdk/#/entity/sap.m.FlexBox/sample/sap.m.sample.FlexBoxBasicAlignment
Kind regards
Sebastian

How to auto Layout Labels

I want to layout my labels like this using auto layout. It works fine in iPad 10.5. But when I move to any other versions of iPad with a larger screen, this design brokes. Anyone, please help me to solve this problem.
Swift 4
Use stack view
Step 1. insert labels inside of stack view
like that
Step 2. add constraints on stack view
from top, bottom, left and right alignment according to your requirement
like that ->
Step 3.
Use Stackview properties
a.) set axis of Stack view Horizontally as well as vertically.
b.) set alignment according to requirements.
c.) set Distribution according to requirements (here i used fill equally).
b.) set Spacing between labels .
See here ->
Now run. it will work, it will show same in all Device like iPhone and iPad and also (horizontal and vertical).
it will show like this(iPhone6splus)
Thank you
It seems like you create/checked constrations only for iPad or iPhone. Change a type of device scoping on Storyboard editor and you can find errors. Take care about UI for all of device types.
You can add constraints by "Add missing Constraints".
1.select your labels
2.And click the "Add missing Constraints"

currency and value always in the same line

i am using the currency control in a responsive table and the currency of the value pops in when the value exeeds a certin width (depends on the screen). I want them to be always displayed in the same line. Ofc i could use the width property to make the column bigger, but that doesnt seem to work out when opening the app on mobile devices.
Any ideas?
Thx in advance, Eric
According to the fiori guidelines there is only one option: move other columns to the pop-in-area to save more space for your column (https://experience.sap.com/fiori-design-web/responsive-table/#responsiveness-and-adaptiveness)
But I would be happy for you if you find a "smarter" solution then adapting column width or using pop-in-area or hiding columns on mobile devices. At the end I believe that full responsivness cannot be achieved with fixed widths ... so working with pop-in-area and hiding columns if possible is the only solution.

Vertical oriented Metro WinJS ListView in Grouped Mode

I'm banging my head against the wall trying to implement a ListView with grouped items that renders like the WP7 LongListSelector shown below. I've tried adding a win-vertical class to the element with the data-win-control="WinJS.UI.ListView" but since win-vertical seems to only apply to the viewport that didn't work. Any help would be greatly appreciated.
What kind of ListView Layout are you using? Using ListLayout instead of GridLayout does change the scroll direction from Horizontal to Vertical. But I don't see an easy way to add a group header for ListLayout list view. For GridLayout, there is a groupHeaderPosition property, but ListLayout object doesn't have this property. (Someone actually complained about the same thing.. at the end of this page)So, you might need to hack around for the group names by adding a dummy "group name" item into your data source and sort it properly.
Ref:
http://msdn.microsoft.com/en-us/library/windows/apps/br211837.aspx
http://msdn.microsoft.com/en-us/library/windows/apps/br211792.aspx

Smartgwt - create a panel with title and a border

This sounds like a pretty simple thing to do but I havent been able to find an easy way to do this. How do I create a panel with a title and a border which can contain my widgets? I have seen the SectionStack class which provides this. But I dont want to create a section stack.
Window can be added to a layout and drawn. But is it the only way or is there a container class that I am missing?
Also, how does one center things? Say a textfield and a button at the center of the page. How is this achieved?
If you are using a DynamicForm, you can give it a border and title with
form.setIsGroup(true);
form.setGroupTitle(title);
This actually works for Canvas, too (which is the superclass of most widgets and layouts in SmartGWT).
(I just had the same problem, and found this question, as well as the thread Is there a "titled Border" on the SmartGWT Forums, which gave this answer. I tried and it seems to work.)
To do form-related tasks, look into DynamicForm. To set the inputs in the form, you use setItems(Item...). A text field is a TextItem. You set it's title to control the label that SmartGWT will build. To get a title for the form, the best I've come up with is to use a container canvas that will contain both the title (probably a Label element) and the DynamicForm. To center the inputs, I believe you'd need to use setAlignment on the DynamicForm.
You could create an object that is actually a VLayout that contains a Label (the tile), has a border as you need and includes a Canvas (the generic stuff you want included).
In my experience, I noticed that very often I have a DynamicForm visible, so I just add a BlurbItem control to diplay the tile and a small explanation.