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
20,501
questions
0
votes
1
answer
3k
views
Knockout and ko.utils.postJson issue
I was using some old example for MVC2, that used a [fromJson] attribute when posting json to a controller action, it worked fine except that it did not catch model errors, so ModelState.IsValid is ...
1
vote
1
answer
997
views
how can one create a master detail cascading dropdowns with json and knockoutjs?
A simple master details scenario:
list of servers
int id
string Name
List<Driver> Drivers
where Driver also has an Id and Name.
returned as JSON from MVC Action on server.
Now i have a ...
20
votes
2
answers
15k
views
How to force an observable to read the value from the DOM Element
I have a hidden input and bind the value to an observable property of my model. I'm using another plugin that internally updates the value of that hidden input, however the observable doesn't update ...
0
votes
1
answer
676
views
Textarea loses value when css binding updates
I have an ASP.NET MVC 3 view using Razor and Knockout.js that is not behaving the way I expect it to. I have a pair of <a> tags that are basically 'agree'/'disagree' links and a text area for ...
14
votes
6
answers
13k
views
Can't get the most simple knockout.js sample to work?
This really bothers me. Please have a look at the Hello World example of knockout.js.
Here is my code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<...
20
votes
5
answers
5k
views
Backbone.js with ASP.NET MVC
In the last few days I've been reading about Backbone.js and how it simplifies JS code interaction with View elements, basically within HTML. I've also read about the differences between KnockoutJS ...
0
votes
1
answer
2k
views
populate dropdowns using Knockout.js
I am new to Knockout.js can anyone let me know how can we populate b dropdowns using Knockout.js.
I have two dropdowns : Employee and Course.
<select id="Employee">
<...
1
vote
1
answer
1k
views
Check and radio button not binding in Knockoutjs
I have a function which builds html controls dynamically with jQuery and Knockout, but check and radio buttons don't work, they are not binding.
function createControls(id, ctrl) {
var obj = $....
1
vote
1
answer
240
views
The difference between the methods in knockoutjs
The difference between getFullName1 and getFullName2 exists ?
ViewModel:
var viewModel = {
firstName: ko.observable("Vasya"),
lastName: ko.observable("Petrov"),
getFullName1: function() {...
3
votes
1
answer
1k
views
Knockout does not sync manual set of option's selected attribute
I'm using this jQuery plugin for a multi select list box http://www.quasipartikel.at/multiselect/, and it's all bound to a view model using knockoutjs.
The plugin sets the option's selected attribute ...
0
votes
1
answer
613
views
KnockJS and JQuery Tutorial assitance needed
http://net.tutsplus.com/tutorials/javascript-ajax/into-the-ring-with-knockout-js/
I've worked to Round 2 – Creating a View, using the code as published on the site, I'm returned an error by FF FB 1.7....
8
votes
1
answer
8k
views
Knockout JS initializing observable array from server data using a javascript type
I'm looking for the best way to initialize a knockout observable array from some server data (ViewBag), and I want the array contents to be of a javascript type I have defined. Without the requirement ...
2
votes
1
answer
3k
views
knockout binding to array element without template works only one-way
Can someone please please help me better understand binding to observable array elements without using templates?
I have a table that contains more than the data that I am attempting to present from ...
7
votes
2
answers
13k
views
How can I display a select list (dropdown) for a Model property in BackboneJS?
I am trying to build a simple contact editor application in Backbone.js and I have run into a bit of an issue that I don't know how to solve because I'm not familiar with Backbone.js yet.
I have a ...
20
votes
1
answer
21k
views
Getting a concrete element from an observableArray
This seems easy but after two hours my head hurts.
I have a categoryIndex (from a select) and I want to get the category from an observableArray who have that Id.
How I do that? I tried with indexOf ...