Questions tagged [knockout.js]
Knockout.js is an open source JavaScript library for dynamic HTML UIs using the Model-View-View Model (MVVM) pattern.
knockout.js
1,743
questions
197
votes
2
answers
44k
views
Difference between knockout View Models declared as object literals vs functions
In knockout js I see View Models declared as either:
var viewModel = {
firstname: ko.observable("Bob")
};
ko.applyBindings(viewModel );
or:
var viewModel = function() {
this.firstname= ko....
135
votes
13
answers
72k
views
jQuery UI datepicker change event not caught by KnockoutJS
I'm trying to use KnockoutJS with jQuery UI. I have an input element with a datepicker attached. I'm currently running knockout.debug.1.2.1.js and it seems that the change event is never being caught ...
87
votes
8
answers
172k
views
Catch error if iframe src fails to load . Error :-"Refused to display 'http://www.google.co.in/' in a frame.."
I am using Knockout.js to bind iframe src tag(This will be configurable with respect to User).
Now, if user has configured http://www.google.com (I know it won't load in iframe, thats why I am using ...
259
votes
4
answers
121k
views
Can you call ko.applyBindings to bind a partial view?
I'm using KnockoutJS and have a main view and view model. I want a dialog (the jQuery UI one) to popup with another view which a separate child view model to be bound to.
The HTML for the dialog ...
16
votes
6
answers
27k
views
Resolve circular references from JSON object
If I have a serialized JSON from json.net like so:
User:{id:1,{Foo{id:1,prop:1}},
FooList{$ref: "1",Foo{id:2,prop:13}}
I want to have knockout output a foreach over FooList but I am not sure how to ...
57
votes
9
answers
50k
views
How to create an auto-complete combobox?
Does any one know the best way to create an autocomplete combobox with Knockout JS templates?
I have the following template:
<script type="text/html" id="row-template">
<tr>
...
<...
17
votes
1
answer
43k
views
Can cleanNode() be used to clean binding?
With below code, input#p_in will be updated with the change of input#s_in. But I have used cleanNode(sec). Could anyone help understand why the binding is not cleared.
<input id="p_in" data-...
229
votes
3
answers
105k
views
Getting "The JSON request was too large to be deserialized"
I'm getting this Error:
The JSON request was too large to be deserialized.
Here's a scenario where this occurs. I have a class of country which hold a list of shipping ports of that country
...
37
votes
5
answers
36k
views
integrating jquery ui dialog with knockoutjs
I am trying to create knockoutjs bindings for jquery ui dialogs, and cannot get the dialog to open. The dialog element is created correctly, but seems to have display: none that calling dialog('open') ...
86
votes
12
answers
48k
views
Knockout.js incredibly slow under semi-large datasets
I'm just getting started with Knockout.js (always wanted to try it out, but now I finally have an excuse!) - However, I'm running into some really bad performance problems when binding a table to a ...
204
votes
5
answers
87k
views
KnockOutJS - Multiple ViewModels in a single View
I'm thinking that my application is getting quite large now, too large to handle each View with a single ViewModel.
So I'm wondering how difficult it would be to create multiple ViewModels and load ...
66
votes
1
answer
35k
views
Example of knockoutjs pattern for multi-view applications [closed]
I am building an application that contains two complex, significantly different (yet with some shared components) views. One view allows the user to run queries and look at search results, and the ...
53
votes
8
answers
66k
views
knockout data-bind on dynamically generated elements
How is it possible to make knockout data-bind work on dynamically generated elements? For example, I insert a simple html select menu inside a div and want to populate options using the knockout ...
52
votes
1
answer
16k
views
Knockout.js containerless "foreach" not working with <table>
This code throws the error (in Chrome): "Cannot find closing comment tag to match: ko foreach: MyPlans":
<table>
<!-- ko foreach: MyPlans -->
<tr>
<td>Test</td&...
44
votes
5
answers
37k
views
Change observable but don't notify subscribers in knockout.js
Is there a way to ignore subscribers on a value change of the observable. Id like to change a value of an observable, but not execute it for the subscribers with knockout.js