Skip to main content

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
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 ...
Charlie's user avatar
  • 10.3k
248 votes
1 answer
55k views

What are the key differences between Meteor, Ember.js and Backbone.js? [closed]

Learning Ember.js / Backbone.js has been on my to-do list for a while. Now that Meteor is out, I am just wondering if anyone with experience of Meteor, Ember.js and Backbone.js can summarize the key ...
K Z's user avatar
  • 30.2k
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 ...
Kayvan Karim's user avatar
  • 2,996
204 votes
14 answers
74k views

How to debug template binding errors for KnockoutJS?

I keep having trouble with debugging problems in KnockoutJS templates. Say I want to bind to a property called "items" but in the template I make a typo and bind to the (non existing) property "item"....
RogierBessem's user avatar
  • 2,624
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 ...
CLiown's user avatar
  • 13.8k
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....
Kev's user avatar
  • 119k
192 votes
4 answers
80k views

How can I get Knockout JS to data-bind on keypress instead of lost-focus?

This example of knockout js works so when you edit a field and press TAB, the viewmodel data and hence the text below the fields is updated. How can I change this code so that the viewmodel data is ...
Edward Tanguay's user avatar
187 votes
8 answers
172k views

Javascript Equivalent to C# LINQ Select

Following this question here : Using the checked binding in knockout with a list of checkboxes checks all the checkboxes I've created some checkboxes using knockout that allow selection from an ...
Chris Nevill's user avatar
  • 6,076
167 votes
8 answers
74k views

Is it possible to data-bind visible to the negation ("!") of a boolean ViewModel property?

I'd like to use a property on my ViewModel to toggle which icon to display without creating a separate computed property of the inverse. Is this possible? <tbody data-bind="foreach: periods"> ...
agradl's user avatar
  • 3,536
156 votes
4 answers
139k views

How to force a view refresh without having it trigger automatically from an observable?

Note: this is mostly for debugging and understanding KnockoutJS. Is there a way to explicitly request Knockout to refresh the view from (already bound) view model? I am looking for something like: ...
THX-1138's user avatar
  • 21.6k
140 votes
6 answers
53k views

TypeScript with KnockoutJS

Is there any sample of using TypeScript with KnockoutJS? I'm just curious as to how they would work together? Edit Here is what I have, seems to work declare var ko: any; declare var $: any; class ...
CallumVass's user avatar
  • 11.4k
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 ...
Jose's user avatar
  • 11k
131 votes
3 answers
91k views

How to use knockout.js with ASP.NET MVC ViewModels?

Bounty It's been awhile and I still have a couple outstanding questions. I hope by adding a bounty maybe these questions will get answered. How do you use html helpers with knockout.js Why was ...
chobo2's user avatar
  • 85k
116 votes
10 answers
119k views

How to clear/remove observable bindings in Knockout.js?

I'm building functionality onto a webpage which the user can perform multiple times. Through the user's action, an object/model is created and applied to HTML using ko.applyBindings(). The data-bound ...
awj's user avatar
  • 7,778
116 votes
2 answers
72k views

When to use ko.utils.unwrapObservable?

I've written a few custom bindings using KnockoutJS. I'm still unsure when to use ko.utils.unwrapObservable(item) Looking at the code, that call basically checks to see if item is an observable. If it ...
arb's user avatar
  • 7,833

15 30 50 per page
1
2 3 4 5
1367