Page 1 of 1
Changing items in Grid based on orientation of iPhone
Posted: Thu Jun 06, 2013 10:58 am
by John5766500
I have coded for a change of orientation on my iPhone and now I want to change the grid columns inside my list component.
If running in landscape mode I want to increase the number of columns in the grid and display more data then if the user switches back to portrait reduce the columns.
Anyone got an example of this? Thinking I could cheat and have two(2) grids and alter the visibility flag based on the orientation? or go with one and change columns in the grid by code?
Changing items in Grid based on orientation of iPhone
Posted: Thu Jun 06, 2013 12:37 pm
by Maryna Brodina
Hello! Working on it, I'll update.
Changing items in Grid based on orientation of iPhone
Posted: Thu Jun 06, 2013 3:33 pm
by John5766500
Hi Marina - I have this working so no need to carry on looking at this for me.
thanks.
Changing items in Grid based on orientation of iPhone
Posted: Thu Jun 06, 2013 3:48 pm
by Kateryna Grynko
Hi,
Thank you for the update.
Changing items in Grid based on orientation of iPhone
Posted: Sat Jul 13, 2013 6:16 pm
by Roger
Where is the event for orientation changed?
Changing items in Grid based on orientation of iPhone
Posted: Sun Jul 14, 2013 4:55 am
by Alena Prykhodko
Please clarify your question.
Changing items in Grid based on orientation of iPhone
Posted: Mon Jul 15, 2013 9:01 am
by Maryna Brodina
Hello! There is no such event inside builder. This should help http://api.jquerymobile.com/orientati.... Create new JS asset with the following code:
codefunction doOnOrientationChange()
{
switch(window.orientation)
{
case -90: case 90:
//addyour code here for landscape orientation
break;
default: //addyour code here for portrait orientation
break;
}
}
$(window).on('orientationchange', doOnOrientationChange);/code