Development on Various Platforms
12.8K views | +0 today
Follow
Development on Various Platforms
Your new post is loading...
Your new post is loading...
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Durandal’s Edge

Durandal’s Edge | Development on Various Platforms | Scoop.it

With so many SPA-style frameworks emerging in the last couple years, you may wonder what makes Durandal unique or different. Why would you want to choose it for your next project?  I’d like to share a few key points to that end…

Rather than re-invent the wheel, Durandal starts by combining and building on top of three existing libraries. Each of these libraries is very mature, has a large, active community and was strategically chosen because it meets one specific need very well. First we start with jQuery. In some ways you can think of it as a better DOM or the “missing JavaScript core library”. Next, we add in RequireJS, which gives us rich, declarative JavaScript modules. Finally, Knockout provides us with powerful two-way data-binding.

With these three libraries as a foundation, Durandal constructs a thin integration layer and transforms them into a powerful SPA framework. In addition to strategically connecting these libraries, Durandal adds new functionality. Some things Durandal adds are:  a client-side router, rich view composition, screen state management, pub/sub, simple conventions, modals/message boxes and more…


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Diving Into KnockoutJS - Houston TechFest 2013 Screencast

Diving Into KnockoutJS - Houston TechFest 2013 Screencast | Development on Various Platforms | Scoop.it

Presentation Layout (0:00 - 1:30)
What is Knockout, Why should I use it? (1:30 - 8:57)
Basic Examples (8:57 - 19:27)
Working with Arrays (19:27 - 26:40)
ViewModel Structures (26:40 - 34:10)
Custom Binding Handlers (34:10 - END)
Why Use Custom Binding Handlers? (34:10 - 37:14)
The ko.bindingHandlers Interface (37:14 - 39:50)
Augment Existing Binding Handlers (39:50 - 46:40)
Common UI Formatting (46:40 - 54:40)
Existing Widgets and Building Widgets (54:40 - END)


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Knockout.js Query Builder

Knockout.js Query Builder | Development on Various Platforms | Scoop.it

On my current project we are in need of a dynamic query-building user interface. In non-geek terms, that means a web page that allows a user to specify fields, constraints, and values that evaluate to some kind of query or expression. Alright that was still a geeky explanation... but if you're reading this then the geek-speak is probably appropriate for you. But I digress...

This little UI is all about the data structure you want the UI to represent. If you can plan the data structure, you can throw the UI on top of it. There may be specific theories and methods on how to properly represent a logical query like this, but I'm not following any particular approach here.

My data structure is as follows:

* Condition - a unit of logic that defines a field, comparison operator, and value (e.g. Color equals 'Black', Quantity is greater than two, etc).

* Group - contains an array of Conditions and Groups, and specifies whether to perform a logical-AND or a logical-OR on all items in the array.

 


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Data-grid using Knockout JS with paging and sorting

Data-grid using Knockout JS with paging and sorting | Development on Various Platforms | Scoop.it

We will build two types of data-grids (tables) in this article:
* One with AJAX based paging and sorting for displaying large number of records
* One with JavaScript based (no-postbacks/AJAX calls) paging and sorting for lesser number of records

In both of the above we want the following:
* Reusable, extensible, and maintainable JavaScript code
* Use Knockout JS (KO)

We would display a list of students, their age, school name, and school address in a data-grid (as shown in the image above).

In this article, I want to demonstrate the use of KO and some basic object oriented JavaScript. There are other good articles on CodeProject demonstrating, for example, the use of jqGrid with MVC 4. However here we will develop the entire data-grid (with paging/sorting functions) to have better control over the generated output.

Though I have used ASP.NET MVC 4 as backend to this project, other technologies (PHP etc.) can be used as well, as the client side code to generate data-grid is agnostic of backend technology. I will keep explaining any particular JavaScript constructs that are a bit tricky for users having only basic knowledge of JavaScript.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Sorting Paging a Grid using Knockout JS and ASP.NET Web API Data Service

Sorting Paging a Grid using Knockout JS and ASP.NET Web API Data Service | Development on Various Platforms | Scoop.it

This article uses ASP.NET Web API and Knockout JS to implement Templating and Data Binding and applies it to a common Line of Business application requirement – Paging and Sorting a Grid

Knockout JS as we know is a highly versatile JavaScript library that helps us implement the MVVM pattern on the client by providing us with two way data binding and templating capabilities. Today we will use Knockout JS and ASP.NET Web API to build an application that represents data in a tabular format with AJAX based sorting and paging capabilities.

Representing Tabular data in a table is as old as web itself and today end users expect a certain amount of features and functionality built in. These include fast access, sorting, paging and filtering. There are well established libraries like Datatables.net that already do these for us. However, knowing how something is implemented, helps us tweak things to our advantage, because no two requirements are the same, ever.


Via Jan Hesse
more...
JonahHayes's curator insight, October 9, 2013 7:40 AM

Knockout JS as we know is a highly versatile JavaScript library that helps us implement the MVVM pattern on the client by providing us with two way data binding and templating capabilities. Today we will use Knockout JS and ASP.NET Web API to build an application that represents data in a tabular format with AJAX based sorting and paging capabilities.

Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Simple Signup and Login with Firebase and Knockoutjs

Simple Signup and Login with Firebase and Knockoutjs | Development on Various Platforms | Scoop.it

In this tutorial you will learn how to set up an effective registration and authentication process for your web app using Firebase, knockoutjs and Twitter Bootstrap.... and..... that's it. No backend mysql database, apache web server, ubuntu linux or ruby scripting is required. You just need to know javascript. You don't even need to know nodejs, npm or requirejs. There really is no back end and it is simple to build.

Knockout uses a MVVM (Model-View-ViewModel) pattern. We are starting with the view which is the body of the index.html file. This is quite straight forward. Twitter Bootstrap is called in through the class attribute of our input and div tags to make our page look nice. Knockout is called in through the data-bind attribute of our input tags and buttons. When the user keys in her user name and password, we want this data to go into application memory (the Model of MVC) and then on to the Firebase servers. Our View gives is the basic entry points that are required.

The View Model is the magic wiring between the View and application memory. We need to wire 3 things to start with ...


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Maintaining and Organizing UI Dependencies with Knockout.JS: Part 2

Maintaining and Organizing UI Dependencies with Knockout.JS: Part 2 | Development on Various Platforms | Scoop.it

If you are experienced with JavaScript, you know about the ongoing war between scope, context and dealing with the this keyword. Previously, we used this on propertiesthis.studentsName = ko.observable('') to refer to the ViewModel object itself. That was all well and good because we didn’t have to worry about tracking what this meant in a nested function within studentsName.

The problem arises when our ViewModel starts becoming more complex. Say, for example, our computed observable function this.challengeCompletedCount uses a nested internal function. Internal functions create a new, separate context with a new this variable. The newthis variable is completely different from the one outside of our internal function.

So far, our little app has been easy to maintain with only one ViewModel and a couple of models, but projects inevitably get larger and more complex. Code becomes quickly cumbersome and hard to maintain, not to mention prone to global variable conflictons. To truly leverage the perks of using an MVVM (model-view-viewmodel) or MVC pattern, you must separate your code into logical modules and decouple the layers. It may take some additional time at the onset of a project, but it will save you and your team headaches (and quite possibly an Anchorman-style street brawl) in the future. So unless tridents and hand grenades are your thing, I suggest using RequireJS to modularize your code.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Falcon.js | Structure for Knockout

Falcon.js | Structure for Knockout | Development on Various Platforms | Scoop.it
Falcon.js is an MV* framework that helps organize small and large single-page applications that wish to utilize Knockout.js for templating and data binding. Models represent individual data objects that need to sync with server data.

Falcon.js is an MV* framework that helps organize small and large single-page applications that wish to utilize Knockout.js for templating and data binding. Falcon provides:

* Models represent individual data objects that need to sync with server data
* Collections represent a list of models and provide numerous list filtering methods
* Views relate functionality between data objects and Knockout templates


Via Jan Hesse
more...
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Knockout.js tips and tricks

Knockout.js tips and tricks | Development on Various Platforms | Scoop.it

Knockout.js is a very powerful 2-way binding MVVM framework for JavaScript built by Steve Sanderson. The basic idea is rather than work directly with the DOM, a ViewModel ties a JavaScript object to the DOM and any updates to the ViewModel are automatically reflected in the DOM and any DOM changes are reflected in the ViewModel. It provides very little opinion on specifics about how to structure applications which makes it flexible.

Below are some tips and tricks I've learned in using Knockout in a few large scale applications.

* Context Issues
* Better ViewModels with a BaseViewModel
* Accidental Rendering Templates
* Using Extenders
* Working with fn
* Require.js
* Custom Bindings
* Conclusion


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Building a Dynamic Application Menu with Durandal.js, Knockout, and Bootstrap

Building a Dynamic Application Menu with Durandal.js, Knockout, and Bootstrap | Development on Various Platforms | Scoop.it

I’m going to do a longer series here about how to create a dynamic menu bar system with Durandal, Knockout, and Twitter Bootstrap.  This menu bar is going to emulate the traditional desktop application menu bar you find in apps (like the File, Edit, or View menus, for example).  The special thing here is that it will be 100% dynamic.  This will allow interesting scenarios such as dynamically altering the application menu when the application is in a different mode or allow something like plug-ins to alter the menu structure adding new commands.


Via Jan Hesse
more...
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Twitter Bootstrap Modals and Knockout.js

Twitter Bootstrap Modals and Knockout.js | Development on Various Platforms | Scoop.it

Displaying modal dialog boxes directly from your Knockout view models turns your application into unmaintainable jQuery spaghetti. Your once clean view model, is now fighting with the DOM and dragging you into callback hell.

Imagine instead maintaining a clear separation of concerns between your view models and your UI. Views models only need to collaborate with other view models, never with the DOM.

This post will teach you how to use Twitter Bootstrap modals in a Knockout.js application, while keeping your code clean and simple.

You'll learn how to use Knockout's built-in function, ko.renderTemplate, to generate a modal dialog box UI, on-demand, from a template.

This post will also show how jQuery's Deferred object can neatly manage the asynchronous nature of displaying a modal dialog and waiting for its result.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Into the Ring with knockout.js

Into the Ring with knockout.js | Development on Various Platforms | Scoop.it

Knockout is not meant to be a replacement for jQuery; jQuery is hugely popular, as you all know I'm a huge fan of it myself, and it's very good at what it does. But it's difficult to create complex user interfaces using jQuery alone; the bigger the application behind the interface, and the more the user can interact with it, the harder it gets to keep some semblance of order. Event handlers abound, and you quickly end up with literally hundreds of lines of code.

In this tutorial we'll build a simple interface that displays a list of contacts and then allows the visitor to interact with the UI to change how the data is displayed, such as filtering the list, or sorting it. We'll use knockout as a layer between our data and the page to simplify the creation and management or our UI.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Knockout.js: Pagination with ASP.NET Web API (or WCF service)

Knockout.js: Pagination with ASP.NET Web API (or WCF service) | Development on Various Platforms | Scoop.it

In this article, I am trying to implement HTML table as a grid with pagination using knockout.js. This is the easiest way to get page wise data from server using ASP.NET Web API (or WCF service) and display them as a grid.

* Define a PagedObservable

* Define a ViewModel

* Define a View

* Web API Controller


Via Jan Hesse
more...
Sergei Vedischev's curator insight, August 31, 2013 3:29 AM

add your insight...

Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

A comparison of the two-way binding in AngularJS, EmberJS and KnockoutJS

This is not a talk about which framework is best, or which one you should use in your projects. The focus is on the strengths and weaknesses of the different implementations and finding out what the different frameworks have in common and what they can learn from each other.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

AngularJS-ish filters in KnockoutJS

AngularJS-ish filters in KnockoutJS | Development on Various Platforms | Scoop.it

As I learn more about AnuglarJS, I find filters to be one of the most exciting features of the framework. Filters allow common, mostly-simple display-level modifications to expressions in a view without having to include that logic in the model (i.e. $scope).

Applying a filter to an expression in an Angular view is super easy: {{ expression | filter }} and you’re done. Angular comes with a handful of filters for scalar values (number, currency, date) and arrays (filter, limit, order) but it’s also pretty easy to write your own.

In addition to “write once, use everywhere” convenience, filters are also chainable. This is particularly useful with Angular’s array filters...


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Knockout.js, Input placeholders, and IE, oh my!

Knockout.js, Input placeholders, and IE, oh my! | Development on Various Platforms | Scoop.it

On tech.pro, almost every form input has a placeholder. Unfortunately, some older browsers (like IE8 and IE9) do not have support for this new attribute. If one follows the prescription of Progressive Enhancement, this is no problem at all — if the text in the placeholder attribute is merely meant to be additional, users with older browsers will not see it but it will not ruin the user experience entirely.

The input placeholder is a perfect example of something that was probably intended to only enhance.

The problem of course, is that sometimes we don't want to be shackled by older browsers. Some forms can be made a lot cleaner visually by using only the placeholder attribute to label the fields.

With Knockout.js the issue is that the value binding was not planning for some pesky jquery plugin to start messing with the actual value of the DOM element. As a result, if you are binding to the input with knockout, while at the same time using the jquery.placeholder plugin to emulate the placeholder behavior, you've just introduced a nightmare for yourself.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Essential Knockout.js, Part 2: Best Practices and More

Essential Knockout.js, Part 2: Best Practices and More | Development on Various Platforms | Scoop.it

The first installment discussed what Knockout.js is, why and how it evolved, and how it fits into Web development. This month, the discussion dives into best practices for Knockout, extending it and creating custom bindings.

To get the most utility out of Knockout's components, the need for the Model-View-ViewModel (MVVM) design pattern must be understood. This architectural pattern arose out of Microsoft's implementation of Martin Fowler's presentation model design pattern to support Windows Presentation Foundation (WPF) and Silverlight.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Developing, Architecting and Testing Web Applications with MVC5, Web API 2, KnockoutJS, Ninject and NUnit

Developing, Architecting and Testing Web Applications with MVC5, Web API 2, KnockoutJS, Ninject and NUnit | Development on Various Platforms | Scoop.it

The goal of this article is to walk through a sample Customer Maintenance web application that implements the latest technology from the Microsoft stack, including the latest beta versions of Microsoft .NET 4.5.1, Visual Studio Express 2013, MVC5, WebAPI 2 and Entity Framework 6. 

Throughout this article various design patterns and techniques will be implemented to help foster a loosely coupleddesign that promotes the Separation of Concerns (SoC) through the various layers of an n-tier web application. Overall the implementation of this sample application is a variation of my previous Code Project article MVC Techniques with jQuery, JSON, Knockout, and C#. 


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

knockout.sync.js - Sync library managing models to be in sync between devices and backends

knockout.sync.js - Sync library managing models to be in sync between devices and backends | Development on Various Platforms | Scoop.it

You want to roll out new version of viewmodel-related functions / computings / validation rules without forcing users to restart? Clients might be using multiple devices at the same time?

knockout.sync.js is a tiny ko-extension giving real-time synchronizing feature to your project.

You modify your form/values on one device and you see the changes on the client devices on the fly transparently.

Server might release new version of computed values or functions and clients can refresh the ko bindings in the background without any programming effort.

The knockout.sync.js supports to synchronize:
* values of the view model in JSON format
* the view model itself including
** static attributes
** models
** computed values
** functions
Currently it uses socket.io library to buid-up websockets as connectivity. If you need different ways, please let me know...


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Maintaining and Organizing UI Dependencies with Knockout.JS: Part 1

Maintaining and Organizing UI Dependencies with Knockout.JS: Part 1 | Development on Various Platforms | Scoop.it

We all know that the larger a project gets, the harder it is to maintain and organize UI dependencies. “What if the user does this, or this? That needs to change that and that.” This can be tough to deal with, especially when a different developer comes onto the project and doesn’t quite understand how you manually set up these dependencies.

Among the plethora of different Javascript libraries that help UI developers create responsive UIs, Knockout.JS has been a pleasure to work with. It knows what it needs to do to help you but also when to get out of the developer’s way.

Knockout aims to help with this by providing the developer with a way to “make elegant dependency tracking, declarative bindings, and be trivially extensible.” Knockout uses the MVVM (model-view-viewmodel) pattern, so if you’re familiar with any other MV* pattern, it should be easy to pick up on. The pattern allows developers to keep the logic in the Javascript and the HTML5 view is left solely to render the logic. What I’ve enjoyed the most about using Knockout.JS is that it makes the web page reactive to the user, like a native desktop app, easily.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

TypeScripted Knockout in ASP.NET MVC

TypeScripted Knockout in ASP.NET MVC | Development on Various Platforms | Scoop.it

We take a look at how to use TypeScript’s definitions for KnockoutJS to build a small ASP.NET MVC application. Along the way we explore the TypeScript language and gauge how it can be potentially used for build ASP.NET MVC applications that lean on the client side JS Libraries for richness and interactivity.

* Getting Started with TypeScript in Visual Studio 2013 Preview
* TypeScript in ASP.NET MVC
* The Task Listing App in TypeScript
* Setting up our Knockout ViewModel using TypeScript
* Updating View to use client side bindings
* Summarizing our TypeScript code


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

A simple photo app with Knockout.js - Lesson 1

A simple photo app with Knockout.js - Lesson 1 | Development on Various Platforms | Scoop.it

In the course introduction we look at what Knockout.js is, what architectural pattern it is built on, and how it can help us rapidly develop sophisticated, interactive user interfaces that don't turn into a tangled mess of event handlers. We also set up our development area ready to start coding in lesson 2.

In lesson 2 we add the wrapper for our app and see how easy it is to create a simple constructor for our application that accepts configuration options and supports chaining. We also saw how to use jQuery's extend method to merge the configuration object with the default properties of the application.

TBC


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

FluentKnockoutHelper - generate Knockout syntax with strongly typed, fluent, lambda expressions for ASP.NET MVC

FluentKnockoutHelper - generate Knockout syntax with strongly typed, fluent, lambda expressions for ASP.NET MVC | Development on Various Platforms | Scoop.it

* Painlessly generate Knockout syntax with strongly typed, fluent, lambda expression helpers similar to ASP.NET MVC
* Rich intellisense and compiler support for syntax generation
* Fluent syntax makes it a breeze to create custom helpers or extend whats built in
* OSS alternative to ASP.NET MVC helpers: feel free to add optional features that everyone in the community can use and I'll merge your pull in ASAP!
* Painlessly provides validation based on .NET types and DataAnnotations in a few lines of code for all current/future application types and changes
* Client side JavaScript object factory (based on C# types) to create new items in for example, a list, with zero headaches or server traffic

 

Durandal.js is a new framework that uses Knockout, jQuery, Require and Sammy that makes it very easy to create single page applications. It 'just works' with Knockout and feels very clean so I have created the Survey App using it. Also take note other than for the start page and WebAPI MVC isn't used at all for views. This seems pretty natural so far but time will tell as it is built out.

Take a look at Survey App demo to see a full demo using Durandal.js


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Automatic Paging with Knockout data-bindings

Automatic Paging with Knockout data-bindings | Development on Various Platforms | Scoop.it

I’ve been a heavy user of Knockout JS and MVVM with JavaScript for over a year and I’ve found most designs can be achieved with the basic data-bindings. There are two scenarios that I have found which require specialized bindings. The first is a select box with numerous options. The second is a long list of data that doesn’t fit on a single screen.

I prefer to use the chosen jQuery plugin to manage unwieldy select boxes. The problem is combining the jQuery plugin with Knockout data-binding. For this I use a Knockout Binding Extension For Chosen. One caveat on this binding is that it can take a while to bind. If you have multiple select boxes with large amounts of data displaying dynamically, you can notice a significant delay. I ran into this problem when binding to an editable grid.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Unobtrusive jQuery Validation for Knockout in ASP.NET MVC

Unobtrusive jQuery Validation for Knockout in ASP.NET MVC | Development on Various Platforms | Scoop.it

In this article, we will explore how we can use the jQuery Validator in an ASP.NET MVC application that uses Knockout Templating. Traditionally, jQuery validator works out of the box with KO ViewModels that are statically bound.

But there are a couple of additional things that you’ve to do when templates are involved and the DOM is manipulated on the fly.

Today we use a slightly different harness from the first two parts because we need validations for the dynamic controls added by the template.


Via Jan Hesse
more...
No comment yet.