Skip to content
This repository

Interactive data-driven views, MVVM and MVP, built on top of JsRender templates

branch: master

Commit 52 (Beta Candidate)

Note that this update brings significant feature improvements
with corresponding changes to the implementation. For normal
usage patterns these do not correspond to breaking changes. However
there could possibly be breaking changes on a few advanced scenarios.
If appropriate, please file issues if breaking changes are
observed. See also the samples and unit tests for changes that take
advantage of new features below.

New features and improvements
- {{: xxx}} can now be used without arguments, so {{:}} is equivalent
  to {{:#data}}. This is a similar pattern to {{for}} {{include}} etc.

- autoBind feature for custom tags allows a custom tag without
  argument to bind to current data context, so {{mytag/}} is
  equivalent to {{mytag #data/}}. This is achieved by setting
  autoBind: true on the tag definition.

- Can now define a converter for the first arg on any tag - custom
  or built-in. e.g. {{for myarray convert=~reverseArray}}
  or {{mycustomtag name convert='someRegisteredConverter'/}}
  or <div data-link="name convert=formatName" /}} (in this example
  the person object has a name property and a formatName method)

- Similarly any tag with two-way binding can have a convertBack
  e.g. <input data-link="name convert=~SomeHelper convertBack=SomeMethodOnDataObject" />
  or {^{slider speed convert=~fromMphToKmH convertBack=fromKmHtoMph/}}
  or: {^{myTextBoxTag convert=~myCnvtHelper convertBack='myregisteredConverter'/}}

- Support for triggering updates to the tag based on dependencies
  declared for the converter as well as dependencies declared on
  the tag itself. There is also a new $.view.sub.getDeps() helper
  function for combining multiple dependency declarations - used
  internally to implement the above feature.

- Improved support for rendering arrays without iteration:
  render(array, helpers) will iterate over the array, but you can
  now pass a 'noIteration' boolean. So render(array, true) renders
  anv array without iteration, and similarly, render(array, helpers, true)
  now renders an array without iteration while passing in helpers.

  Within methods and events of custom tags:
  tagCtx.render() renders against the current data object,
  tagCtx.render(someArray) iterates over the array
  tagCtx.render(someArray, true) or tagCtx.render(someArray, helpers, true)
  renders without iteration.

- In a custom tag, a template can now be assigned (determined
  dynamically) in the init method simply by setting:
  this.template = templateObjectOrMarkupString;
  It is no longer necessary to write:
  this.template = tagCtx.tmpl = templateObjectOrMarkupString;

- Support for declaring event handlers directly on tags or
  data-link expressions: {{anyTag onXxx=myXxxHandler /}}
  This can be used for standard event handlers such as onUpdate,
  onBeforeChange etc.
  e.g. <textarea data-link="text onUpdate=updateMethodOnViewModelObject"></textarea>

- There is a new helper utility function for validation of
  HTML markup in JsViews: $.views.utility.validate(markupString)
  This could be used in the following example:
  $.views.helpers("validateMarkup", $.views.utility.validate);
  <textarea data-link="text onBeforeChange=~validateMarkup"></textarea>

- Improved error message if JsViews or JsObservable is loaded without jQuery

Bug fixes:
- Fix for BorisMoore/jsrender#231
- Fix for #198
- Fix for #231

- Fix for a memory leak issue

- Fixes for some issues with radio buttons and with multiselect

- Fixes for bugs in some samples
latest commit fe24e43a00
Boris Moore authored
Octocat-spinner-32 demos Commit 46 (Beta candidate) November 24, 2013
Octocat-spinner-32 test Commit 52 (Beta Candidate) March 25, 2014
Octocat-spinner-32 MIT-LICENSE.txt Commit 42 (post beta) September 22, 2013
Octocat-spinner-32 Added demo for using top-level binding, and data-link="{for ...}" June 19, 2013
Octocat-spinner-32 jquery.observable.js Commit 52 (Beta Candidate) March 25, 2014
Octocat-spinner-32 jquery.observable.min.js Commit 52 (Beta Candidate) March 25, 2014
Octocat-spinner-32 Commit 52 (Beta Candidate) March 25, 2014
Octocat-spinner-32 jquery.views.js Commit 52 (Beta Candidate) March 25, 2014
Octocat-spinner-32 jquery.views.min.js Commit 52 (Beta Candidate) March 25, 2014
Octocat-spinner-32 Commit 52 (Beta Candidate) March 25, 2014
Octocat-spinner-32 jsrender.js Commit 52 (Beta Candidate) March 25, 2014
Octocat-spinner-32 jsrender.min.js Commit 52 (Beta Candidate) March 25, 2014
Octocat-spinner-32 Commit 52 (Beta Candidate) March 25, 2014
Octocat-spinner-32 jsviews.js Commit 52 (Beta Candidate) March 25, 2014
Octocat-spinner-32 jsviews.min.js Commit 52 (Beta Candidate) March 25, 2014
Octocat-spinner-32 Commit 52 (Beta Candidate) March 25, 2014

JsViews: Next-generation MVVM and MVP framework - bringing templates to life

The power of MVVM, the flexibility of JavaScript, the speed and ease of JsRender templates

JsViews builds on top of JsRender templates, and adds data-binding and observable data, to provide a fully-fledged MVVM platform for easily creating interactive data-driven single page apps and websites.

JSRender and JsViews together provide the next-generation implementation of both JQuery Templates, and JQuery Data Link - and supersede those libraries.

See also the JsRender repository on GitHub

Documentation and Downloads

Documentation, downloads, samples are available on the website.
(JsViews and JsObservable API docs and tutorials are coming soon, as we move JsViews to the official beta and on to V1.0)


In addition to the demos at, see also the demos folder of this GitHub repository - available here as live samples.

Current Status

JsViews is now an alpha release, which will be declared beta as soon as API documentation is complete on the website, and then move to V1.0.

Something went wrong with that request. Please try again.