Skip to content
This repository
branch: master

Commit 52 (Post Beta)

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'/}}

- 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 #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 ecfe12750c
Boris Moore authored
Octocat-spinner-32 resources Commit 27. Major update - {{else}} with any tag, {{include}} etc. February 26, 2013
Octocat-spinner-32 scenarios Commit 52 (Post Beta) March 25, 2014
Octocat-spinner-32 step-by-step Commit 42 (post beta) September 22, 2013
Octocat-spinner-32 variants Commit counter 22. Major update, including some BREAKING CHANGES, and… December 02, 2012
Octocat-spinner-32 demos.html Commit 27. Major update - {{else}} with any tag, {{include}} etc. February 26, 2013
Octocat-spinner-32 index.html Commit 44 (post beta) October 19, 2013
Something went wrong with that request. Please try again.