Questions tagged [jquery-templates]

jQuery templates is a plugin written by the Microsoft ASP.NET team in collaboration with the open-source jQuery team to enrich the UI from a data context.

templates is a plugin written by the Microsoft ASP.NET team in collaboration with the open-source jQuery team to enrich the UI from a data context.

It was a jQuery official plug-in and is now at https://github.com/BorisMoore/jquery-tmpl (GitHub project of primary developer).

Note: jQuery Templates will be superseded by JsRender - see:

756 questions
90
votes
2 answers

Access index of $parent in knockout.js

In knockout.js 2.1.0, in a template using the foreach binding, you can access the current item's index though the $index() function. In a nested foreach binding, is there any way to access the index of the $parent from a template? Say I have a data…
Jørgen
  • 8,820
  • 9
  • 47
  • 67
72
votes
2 answers

Bind to simple array of strings

If I want to bind a template to a plain old array of strings, what do I put in the ${??} expression? I hope this snippet isn't too short so as to confuse:
where authors…
Adam Rackis
  • 82,527
  • 56
  • 270
  • 393
39
votes
8 answers

How to output ${expression} in Freemarker without it being interpreted?

I'm trying to use Freemarker in conjunction with jQuery Templates. Both frameworks use dollar sign/curly brackets to identify expressions for substitution (or as they're called in freemarker, "interpolations") , e.g. ${person.name} . So when I…
Glenn Barnett
  • 2,031
  • 1
  • 21
  • 31
35
votes
4 answers

jQuery Templates are deprecated?

I see that per the jQuery plugin template page that jQuery plugins have gone from beta to deprecated without passing a real release. I can't find any info on jquery.com or their related sites about why. Or when a replacement might be available.…
JJO
  • 744
  • 1
  • 6
  • 11
29
votes
2 answers

Avoiding ambiguous mustaches from Jinja2 that includes jQuery templates

I'm trying to insert jQuery templates into Jinja2 templates. Alas they both (in the default setup) use the mustaches {{ & }} to indicate expressions and literals, respectively. I'm inserting my jQuery templates into HTML with script tags, like…
Brian M. Hunt
  • 81,008
  • 74
  • 230
  • 343
28
votes
8 answers

Simplest way to get current item index within jQuery template

I am passing an array of objects to jQuery template (official jquery-tmpl plugin): $("#itemTmpl").tmpl(items).appendTo("body"); inside a jQuery Template??