Cant get it to work

186 views
Skip to first unread message

JSN

unread,
Feb 18, 2012, 8:36:54 AM2/18/12
to jLayout
Hi
Im trying to use the jlayout, and it gives me a error, when displaying
the page. It happens when the jlayout is trying to load.
The error is 'jLayout' is not defined in the line.
if (jQuery && jLayout) {
First line of the jlayout.

im using version 1.7 of jquery

Can some one help to what im doing wrong. (The demo pages work fine,
but they also use 1.4 of jq. and all the smaller .js, such as border
etc. are they nessesery, (i have tried and no difference)

here is the code.
<!DOCTYPE>
<html >
<head>
<script type="text/javascript" src="/System/Scripts/jquery/
jquery.js"></script>
<script type="text/javascript" src="/System/Scripts/Other/
jquery.metadata.js"></script>
<script type="text/javascript" src="/System/Scripts/Other/
jquery.sizes.js"></script>
<script type="text/javascript" src="/System/Scripts/Other/
jquery.jlayout.js"></script>
<title></title>

<script type="text/javascript">
$('#my-container').layout();
</script>
</head>
<body>
<div id="my-container" class="{layout: {type: 'grid', columns: 2,
rows: 2}}">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
</div>
</body>
</html>


Regards
JSN

Bram Stein

unread,
Feb 18, 2012, 9:56:50 AM2/18/12
to jLayout
Hi,

I've recently made some updates to jLayout, and tested it with the
latest jQuery versions. The jQuery metadata plugin is no longer
required with the newer version. Please have a look at my Github
repository: https://github.com/bramstein/jlayout it contains the
latest version as well as up to date examples and documentation.

Updating my website is high on my todo list :)

Bram

Jesper Nielsen

unread,
Feb 19, 2012, 1:15:22 PM2/19/12
to jla...@googlegroups.com
ok, ill try it
 
Thanks for the fast reply and nice work :-)
 
Regards
JSN

2012/2/18 Bram Stein <b.l....@gmail.com>
--
You received this message because you are subscribed to the Google Groups "jLayout" group.
To post to this group, send email to jla...@googlegroups.com.
To unsubscribe from this group, send email to jlayout+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jlayout?hl=en.


Jesper Nielsen

unread,
Feb 19, 2012, 1:43:36 PM2/19/12
to jla...@googlegroups.com
Hi, the problem still persists.

but when the line
<script type="text/javascript" src="/System/Scripts/Other/jlayout.border.js
e.g. with the border.js is added then the error disappers?

so the error that fails the load of jlayout, requries the border.js

here is the code that works (i copied you example)

 <!doctype html>
<html>
<head>
<title>jLayout Examples</title>
<meta charset="utf-8">
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<!--<script type="text/javascript"
src="/System/Scripts/jquery/jquery.js"></script>-->
<script type="text/javascript"
src="/System/Scripts/Other/jquery.sizes.js"></script>
<!--<script type="text/javascript"
src="/System/Scripts/Other/jlayout.grid.js"></script>-->
<!--<script type="text/javascript"
src="/System/Scripts/Other/jlayout.flexgrid.js"></script>-->
<!--<script type="text/javascript"
src="/System/Scripts/Other/jlayout.column.js"></script>-->
<!--<script type="text/javascript"
src="/System/Scripts/Other/jlayout.flow.js"></script>-->
<script type="text/javascript"
src="/System/Scripts/Other/jlayout.border.js"></script>
<script type="text/javascript"
src="/System/Scripts/Other/jquery.jlayout.js"></script>
<script type="text/javascript">
jQuery(function ($) {
$('.grid').layout();
$('.flex-grid').layout();
$('.column').layout();
$('.border').layout();
etc.

so the border is requried. or else the error appers.

Regards
Jesper

Bram Stein

unread,
Feb 19, 2012, 1:48:18 PM2/19/12
to jla...@googlegroups.com
Hi,

You need to include the file corresponding to the layout you want to
use. So if you want to use a border layout you'll need to include
jlayout.border.js in addition to jquery.jlayout.js (and of course
jQuery itself.)

Best,

Bram

Jesper Nielsen

unread,
Feb 19, 2012, 2:11:24 PM2/19/12
to jla...@googlegroups.com
ok, :-)

I thougth that usign the jquery version included the others.

so just for clarification, using jquery is to use the meta approach or?

Regards
Jesper


2012/2/19 Bram Stein <b.l....@gmail.com>:

Bram Stein

unread,
Feb 19, 2012, 2:18:59 PM2/19/12
to jla...@googlegroups.com
No, you can use both approaches, the jQuery plugin allows either using
a `data-layout` attribute or specifying everything in code.

Best,

Bram

Theresa Newman

unread,
Feb 19, 2012, 3:15:54 PM2/19/12
to jla...@googlegroups.com
This google group needs an indicator in the subject that it is from a group, looks like spam

the subject of this email is "Re: Cant get it to work"

Bram Stein

unread,
Feb 19, 2012, 3:32:34 PM2/19/12
to jLayout
Good idea, I've turned that feature on. Thanks :)

On Feb 19, 9:15 pm, Theresa Newman <theresa.web...@gmail.com> wrote:
> This google group needs an indicator in the subject that it is from a
> group, looks like spam
>
> the subject of this email is "Re: Cant get it to work"
>
> > > 2012/2/18 Bram Stein <b.l.st...@gmail.com>
>
> > >> Hi,
>
> > >> I've recently made some updates to jLayout, and tested it with the
> > >> latest jQuery versions. The jQuery metadata plugin is no longer
> > >> required with the newer version. Please have a look at my Github
> > >> repository:https://github.com/bramstein/jlayoutit contains the
Reply all
Reply to author
Forward
0 new messages