PURE with Jquery Mobile

43 views
Skip to first unread message

Brandon Murray

unread,
Jan 17, 2012, 10:01:49 AM1/17/12
to JavaScript Templates Engine PURE
I'm attempting to use PURE with my jquery mobile app. Jquery Mobile
stores page state info inside of divs. For example:
<div class="ui-content ui-body-f" data-theme="f" data-role="content"
role="main">role="content"theme="f"
<div class="ui-grid-a"> ...

Notice the role="content"theme="f"

The parent div stores much more page state info than this, I'm just
using this as a simple example. What I'm seeing is that when I render
my data with pure, ALL the page state info is being stripped out. As a
result, this is causing problems with my app.

Mic (BeeBole)

unread,
Jan 25, 2012, 4:21:32 PM1/25/12
to JavaScript Templates Engine PURE
Sorry Brandon for the delay, as it was your first post you were
moderated by default.
And surprisingly I didn't receive any email notification for it.

May be you are compiling the template without jQuery's attributes.
Then jQuery put its attribute in the HTML.

Finally you render your compiled template(without attribute) on the
existing(with attributes)
Do you have any example of code?

Brandon Murray

unread,
Feb 22, 2012, 10:17:56 AM2/22/12
to JavaScript Templates Engine PURE
No worries. I too apologize for the delayed response. You are correct
in that I wasn't compiling with the jqm attributes. I still have the
problem if I try to apply the template (with jqm attributes) to the
entire document. It's not stripping them out, but it's definitely not
playing well with the attributes under the parent div (role="page"
div). What I did was I had to break up the rendering of the document
like so:
var $page = $("#myId");

$page.children( ":jqmData(role=header)" ).directives(...).render(data);

$page.children( ":jqmData(role=content)" ).directives(...).render(data);
Works, but I'd prefer not to call render more than once on the page. I
don't notice a performance hit, so I'm not too worried about it.
Reply all
Reply to author
Forward
0 new messages