In this article, Dave Ward describes how to use the jQuery plugin jTemplate to create what he calls a "client side repeater", that parses JSON data into a template on the client side.
Toward the end of the article, he suggests that the template is placed in a separate file with the extension ".tpl", and that the data is loaded into the ...
I currently use jTemplates to create a rather large table on the client, each row has a button that will open a jQuery UI dialog. However, when I scroll down the page and click on one of those buttons, jQuery dialog will open, but the scroll position get lost and the page jumps back to the top (with the blocking and the actual dialog sho...
Hi all,
is there a way with jTemplates to escape {$, so i can use inline javascript in my onBlur like
<a href="http://www.telegraaf.nl" onclick="if ( a ) {$('#something').css ('display','none');alert('some msg');}">telegraaf</a>
which gets this after processTemplate:
<a onclick="if ( a ) " href="http://www.telegraaf.nl">
T...
I'd like to include some html in a jTemplate variable - e.g.
<td class="numeric">{$T.total_price}</td>
Where total_price is:
"$12<span>.00</span>"
Is there any way I can get the span to show up as html?
...
Hi
I have the following JSON date returned from a MVC page e.g.
"DateProcessed":"\/Date(1258125238090)\/"
and I am using JTemplates to process the data as below.
$('#result').setTemplate($("#TemplateResultsTable").html());
$("#result").processTemplate(data);
This is my results template
<script type="text/html" id="TemplateResults...
I have this template:
<ul id="warningMessages" style="text-align: left; padding-left: 4px;">
{#foreach $T as msg}
<li>{$T.msg.Value}</li>
{#/for}
</ul>
When applied look like this:
<ul>
<li>Value 1</li>
<li>Value 2</li>
</ul>
The style and id information ("id="warningMessages" style="text-align: left; paddin...
I've been working with the JTemplates plugin which I've used to create a form that is bound to a json object via a template. Works perfectly. What I would like to do though is instead of submitting the form I'd like to re-serialize it back into the json object from which it originated and pass it back to the controller method as a json...
I using jTemplate for showing rss item in my page. but description of each item not render right.
My Template is:
<table>
<thead>
<tr>
<th>Date</th>
<th>Title</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{#foreach $T.Items as post}
<tr>
<td>{$T.post.PubDate}</td>
<td><a href="{$T....
Once I create dom elements base on json data with jtemplates, what is the best way to reorder those elements based on changes to the json data (sorting, filtering, etc.).
...
I need to display a currency within a jTemplate.
{parseInt($T.product.Details[0].Price).toFixed(2)} displays as 34.50, but i should be displayed with a comma like 34,50.
I tried several functions to replace the point with a comma, but no luck so far. Anyone who can point me in the right direction?
Mark
...
Hi,
I'm having a weird issue with a function I'm trying to call from within a jTemplates template giving the error "XYZ.getFriendlyName is not a function". It seems like I must have overlooked something simple, but I've tried everything I can think of and the error persists. The code looks like this:
<input type="text" value="{#if $T.R...
I am using jTemplates to format data returned from a json query. I am trying to transform the div with the id "fundingDialogTabs" into jQuery tabs after the template is processed. It renders the tab buttons, but both fragment1 and fragment2 divs are showing at the same time. I get the error "jQuery UI Tabs: Mismatching fragment identifie...
I am using the excellent jTemplates plugin to generate content.
Given a data object like this...
var data = {
name: 'datatable',
table: [
{id: 1, name: 'Anne'},
{id: 2, name: 'Amelie'},
{id: 3, name: 'Polly'},
{id: 4, name: 'Alice'},
{id: 5, name: 'Martha'}
]
};
..I'm wondering if it is possible to directly specify an ob...
I have an html file where i am loading images from an xml file in to it. i am using jtemplate for that. I am getting the images properly.but i want to display them horizontaly those are coming as vertical. Please help me to do that,This is the sample.
...
Hi
I am extracting data from an xml file converting it into json and rendering the images which i am retriving to the html file via jtemplate.now i want to user scroller and scroll the images .i can call to the scroller plugin but it is not scrolling throuhg . can any one help me please.
...
function(result)
{
var lParsedResult = result.d;
var userTyp = "test"; //getting this value from some other source
$("#accountList").setTemplate($("#accountListTemplate").html());
$("#accountList").processTemplate(lParsedResult);
}
<div id="accountList">
<script type="text/html" id="accountListTemplate"...
My collection is ordered alphabetically, but when I assign the collection and load the html using jquery jtemplates, things are coming out un-ordered.
{#foreach $T.results as r}
<li>{$T.r.Name}</li>
{#/for}
Is this expected behavior?
...
Hello,
I'm trying to include some javascript code inside a template.
The code of my html page :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
...
Is there any way to process the template and be alerted to errors?
...
Has anyone had any experience with using jTemplates to display autocomplete results.
I have the following
$("#address-search").autocomplete({
source: "/Address/SearchAddress",
minLength: 2,
delay: 400,
focus: function (event, ui) {
$('#address-search').val(ui.item.name);
return false;
},
parse: func...