John5766500
Posts: 0
Joined: Wed Apr 17, 2013 2:07 pm

Changing items in Grid based on orientation of iPhone

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?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Changing items in Grid based on orientation of iPhone

Hello! Working on it, I'll update.

John5766500
Posts: 0
Joined: Wed Apr 17, 2013 2:07 pm

Changing items in Grid based on orientation of iPhone

Hi Marina - I have this working so no need to carry on looking at this for me.

thanks.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Changing items in Grid based on orientation of iPhone

Hi,
Thank you for the update.

Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Changing items in Grid based on orientation of iPhone

Where is the event for orientation changed?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Changing items in Grid based on orientation of iPhone

Please clarify your question.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Changing items in Grid based on orientation of iPhone

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

Return to “Issues”