Questions tagged [jtemplate]

jTemplate is a plugin written for the jQuery JavaScript library.

jTemplate is a template engine used in conjunction with the jQuery library.

It's current features include:

  • 100% in JavaScript
  • precompilator
  • Support JSON
  • Work with Ajax
  • Allow to use JavaScript code inside template
  • Allow to build cascading templates
  • Allow to define parameters in templates
  • Live Refresh! - automatic update content from server

Template Example:

    var data = { "header": "Header Text", "text": "Hello World!" };

    //Where result is the template target
    $("#result").setTemplate(
          '<h3>{$T.header}</h3>' +
          '<p>{$T.text}<p>');

    $("#result").processTemplate(data);
31 questions
31
votes
4 answers

How do I prevent scrolling to the top of a page when popping up a jQuery UI Dialog?

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…
Kiwik
  • 355
  • 1
  • 3
  • 6
4
votes
3 answers

Best way to reorder dom elements based on json data

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.).
Ryan
  • 73
  • 7
4
votes
2 answers

jTemplates: html in variables

I'd like to include some html in a jTemplate variable - e.g. {$T.total_price} Where total_price is: "$12.00" Is there any way I can get the span to show up as html?
EoghanM
  • 25,161
  • 23
  • 90
  • 123
3
votes
1 answer

jTemplate and MicrosoftAjaxTemplates encode or decoded html (browser not render as html)

I using jTemplate for showing rss item in my page. but description of each item not render right. My Template is: …
Hamid
  • 1,099
  • 3
  • 22
  • 37
3
votes
2 answers

JTemplates format Date using asp.net mvc

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…
Rippo
  • 22,117
  • 14
  • 78
  • 117
3
votes
5 answers

jTemplates escape {$

is there a way with jTemplates to escape {$, so i can use inline javascript in my onBlur like telegraaf which gets this after…
Henk
  • 704
  • 6
  • 14
2
votes
2 answers

Using jTemplate with ASP.NET MVC

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…
Tomas Aschan
  • 58,548
  • 56
  • 243
  • 402
2
votes
3 answers

Why does the HTML in my JSON response get encoded?

I'm using this blog post as a guide, detailing how to use jQuery with jTemplates to stuff a JSON response into a template. My problem is, one of the returned fields (named Description) contains HTML, but the HTML brackets are getting encoded to…
Chaddeus
  • 13,134
  • 29
  • 104
  • 162
2
votes
1 answer

JTemplates serialization

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…
Bob J.
  • 21
  • 1
1
vote
1 answer

jtemplates append instead of overwrite

I'm using jtemplates (jquery plugin) as my templating solution which rocks by the way! I replaced my asp.net updatepanels with this and my god what a speed booster. The problem I have however is that I'm loading user comments under an article with…
Mark
  • 139
  • 1
  • 9
1
vote
2 answers

Compositing Multiple Templates in jTemplates

Using jTemplates, it is possible to composite templates like so...
Date Title Description