Rajon - Rest Ajax Javascript Over Network

Rajon is a javascript MVVM library, that tries to apply the famous and nice WPF pattern to the web development enviroments.
Basically it creates a "ViewModel" for any html element at your webpage, the "Model" is then binded from the server at the client side using Ajax calls.

You just need to specify a model source, rajon:modelSrc, at the desired html element.
The model source can be a REST url, an JSON string or even another viewmodel at the page.

Using all Orders from a REST service as model source for a HTML DIV tag:
<div rajon:modelSrc="OrderService/Orders" >

Using an Order object, identified by number 1, from a REST service as model source for a DIV tag:
<div rajon:modelSrc="OrderService/Orders/1" >

Using a JSON string as a model source or a DIV tag:
<div rajon:modelSrc='= { OrderNumber: 1, ClientName: "ACME" }' >

Once you provide a model source you can use the rajon:bind to bind any object property to any HTML element property.

Binding the OrderNumber object property to a SPAN tag
<span rajon:bind="model.OrderNumber">

Binding the OrderClient object property to a INPUT TEXT tag
<input type="text" rajon:bind="model.OrderClient">

Binding the TotalWeight object property to a DIV, width property
<div rajon:bind="style.width=model.TotalWeight">

You can do a lot more with Rajon:
  • use templates;
  • create ViewModel client properties;
  • update and insert at your model source
  • and more....

Rajon is plataform independent and runs with any server-side language, such as .Net, PHP, ASP, Java etc...

You can add the beta version (rajon-beta0.min.js) at your web page and try it!

Please, see our source ciode and samples for detailed information at: http://rajon.codeplex.com/SourceControl/list/changesets

Last edited Jan 21, 2011 at 10:48 AM by klot, version 9