Page 1 of 1

ui-responsive class for responsive grid

Posted: Fri Jun 14, 2013 5:48 pm
by doubletake

How do I make a grid responsive using the ui-responsive class defined at the bottom of this page?
http://api.jquerymobile.com/responsiv...

I adding a grid and setting the class property to ui-responsive, but it doesn't seem to work when I change the size of the screen in Appery.io test.

I tried with a 3 col grid with 2 rows.

I expected them to go vertical on the phone, but show as 3 columns on tablet. See attached screenshots.

Thanks,
Don

Image Image


ui-responsive class for responsive grid

Posted: Fri Jun 14, 2013 5:58 pm
by Maryna Brodina

Hello! Please post the CSS you used for responsive grid.


ui-responsive class for responsive grid

Posted: Fri Jun 14, 2013 6:56 pm
by doubletake

not using css. The JQM link above (near bottom of that page) says you just have to add a class ui-responsive to the grid.

I added this to the class on the properties.

I didn't try their custom CSS option. I was just trying ui-responsive class default.

Image


ui-responsive class for responsive grid

Posted: Fri Jun 14, 2013 7:17 pm
by doubletake

I also tried their custom CSS recommendation, but that isn't working either.

I added the my-breakpoint to the class name too.

Neither seem to make the grid responsive. (unless I have to test this on the actual device.)

code
@media all and (max-width: 50em) {
.my-breakpoint .ui-block-a,
.my-breakpoint .ui-block-b,
.my-breakpoint .ui-block-c,
.my-breakpoint .ui-block-d,
.my-breakpoint .ui-block-e {
width: 100%;
float:none;
}
}
/code


ui-responsive class for responsive grid

Posted: Fri Jun 14, 2013 7:36 pm
by Maryna Brodina

Appery.io Grid component is a table, but the Grid exposed here http://api.jquerymobile.com/responsiv... is a nested div. So you can't use this style for Appery.io Grid, but you can try to create table through JS or HTML panel as shown here http://api.jquerymobile.com/grid-layout/. This way you can apply ui-responsive class.


ui-responsive class for responsive grid

Posted: Fri Jun 14, 2013 7:39 pm
by doubletake

I also tested it on my iPhone and it didn't adjust to single column.

This code below works fine outside of Appery.io. But, if I look into Appery's generated code in the element inspector, I see that it creates a table, instead of nested divs, to make the grid. That may be why it doesn't work. No idea, just a thought.

Don

code
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>responsive-grid demo<&#47;title>
<link rel="stylesheet" href="http:&#47;&#47;code&#46;jquery&#46;com&#47;mobile&#47;1&#46;3&#46;1&#47;jquery&#46;mobile-1&#46;3&#46;1&#46;min&#46;css">
<script src="http:&#47;&#47;code&#46;jquery&#46;com&#47;jquery-1&#46;10&#46;0&#46;min&#46;js"><&#47;script>
<script src="http:&#47;&#47;code&#46;jquery&#46;com&#47;mobile&#47;1&#46;3&#46;1&#47;jquery&#46;mobile-1&#46;3&#46;1&#46;min&#46;js"><&#47;script>
<style>
@media all and (max-width: 35em) {
&#46;my-breakpoint &#46;ui-block-a,
&#46;my-breakpoint &#46;ui-block-b,
&#46;my-breakpoint &#46;ui-block-c,
&#46;my-breakpoint &#46;ui-block-d,
&#46;my-breakpoint &#46;ui-block-e {
width: 100%;
float:none;
}
}

<&#47;style>
<&#47;head>
<body>

<div data-role="page" id="page1">
<div data-role="header">
<h1>Responsive Grid Example<&#47;h1>
<&#47;div>
<div data-role="content">
<div class="ui-grid-b my-breakpoint">
<div class="ui-block-a"><div class="ui-body ui-body-d">Block A<&#47;div><&#47;div>
<div class="ui-block-b"><div class="ui-body ui-body-d">Block B<&#47;div><&#47;div>
<div class="ui-block-c"><div class="ui-body ui-body-d">Block C<&#47;div><&#47;div>
<&#47;div>
<&#47;div>

<&#47;body>
<&#47;html>
/code


ui-responsive class for responsive grid

Posted: Fri Jun 14, 2013 7:41 pm
by Maryna Brodina

You're absolutely right, see my comment above.


ui-responsive class for responsive grid

Posted: Fri Jun 14, 2013 7:53 pm
by doubletake

Sorry. I assumed Appery Grid was a JQueryMobile grid. my bad.
http://api.jquerymobile.com/grid-layout/

Hopefully you will be adding this capability in the future.

Using Panel is fine backup, but then I can't leverage your design builder for the components inside it.

Thanks,
Don