Email: info@zenconix.com

Durandal JS for aspx page



Visit Site:

Overview

Hello all,

In last post we have seen what can be possibilities for single page application here

Today I have face very complex problem. Actually its a little one, but because of less documentation on the internet and no reference it was quite difficult to solve. But after some study of framework, I got the solution

I have created some demos with Durandal framework. Its having some different folder structure and some different configuration but with demo  or starter kit of its, you will get to know its work with HTML and js very will but my requirement was, it should run with aspx page too. Means I want aspx page as view for that I could not find solution on internet and api documentation of the framework too.

But I have find solution

What I done is, I have made some changes in the framework itself It having one js file named viewEngine.js. The viewEngine module provides information to the view Locator module which is used to locate the view’s source file. The viewEngine also transforms a view id into a view instance.

It just parse the HTML and if it found any other file, then it use parseHTML function of jquery

but It take default extension as .html so I have change the default extension to .aspx so it will only render aspx pages.

Note: If you are following started kit of Durandal, and made changes as I mention above then you also need to change the file extension of shell.html to shell.aspx because by above changes it will just render aspx files not html files as view

Enjoy, Have a great day ahead

 

 

Features

Specifications

Preview

Single Page Application (SPA)



Visit Site:

Overview

I am creating new project in sharePoint 2013 and client requirement was a single page application. Then I started searching for requirement of SPA.

It should satisfy following conditions:

1) Proper navigation and history maintenance.

2) Notification after complete operation.

And main is

3) Data Binding

So for develop this we can have 2 approaches first is that use separate javascript libraries for specific function or you can also use some existing javascript functions

we can use knockout.js for data binding operation

sammy.js for navigation and history maintenance

toastr.js for notification purpose

But this all things also can be done with some framework available

We can use 2 great framework for SPA

1) Anguler JS– can get more information here http://angularjs.org/

2) Durandal JS – http://durandaljs.com/

here the differance is that angular Js uses only jquery and if jquery fails to load then it uses its one JqLite file for all operation while Durandal Js uses 3 top library knockout.js for data binding, require.js for loading js file and jquery for UI rendering

durandal and angular

Its good framework. you will get more information for this here http://www.johnpapa.net/spa/

Features

Specifications

Preview