user1252287
user1252287

Reputation:

How to integrate JayData with Knockout

I'm evaluating Knockout to use with JayData to create a standalone web application. Following this tutorial (http://jaydata.org/tutorials/creating-a-stand-alone-web-application) it seems that I will be able to store my data on iPhone, Android and in HTML5 browsers...

I'm not sure how can I use JavaScript Query Language with Knockout. I've seen they will have some support it, but I probably you have an idea how can I do it myself.

I'm not sure if Knockout is the appropriate UI library for hybrid applications, hopefully you can share some know-how. Thank you!

Upvotes: 2

Views: 916

Answers (3)

Peter Aron Zentai
Peter Aron Zentai

Reputation: 11740

UPDATE: From version 1.1.0 JayData has knockoutjs integration module. Include "jaydatamodules/knockout.js" in your html page, and have JayData provide Knockout observables with entity.asKoObservable(). With this module queryable.toArray() accepts ko.ObservableArrays as targets populating it with kendo observable entities.

Custom Bindings is just the way for the integration you are after. You have to connect the knockoutjs way of interacting with the JavaScript objects with the JayData entity metadata functions and its propertyChanged / propertyChanging events.

It shouldn't be difficult a task to do, as JayData supports simple property notation (object.property) and async property accessor pattern (get_property(cb), set_property(cb)) as well.

Upvotes: 1

Lokeshwer
Lokeshwer

Reputation: 1139

Here is an example It is integrated in recent release probably

Upvotes: 0

arb
arb

Reputation: 7863

You can integrate Knockout with jQuery by way of Custom Bindings. That answers your question about integration. Custom bindings allow you to integrate with any JavaScript UI library, not just jQuery.

In regards to your second question... Knockout really isn't a UI library. It's more of a framework to facilitate data-binding between DOM objects and JavaScript objects. It is used to design web applications following the MVVM design paradigm.

Upvotes: 0

Related Questions