Questions tagged [knockout-2.0]

Knockout.js is an open source JavaScript library for dynamic HTML UIs using the Model-View-View Model (MVVM) pattern. This tag is for questions specific to the 2.0 releases.

Knockout.js is an open source JavaScript implementation of the Model-View-ViewModel (MVVM) UI pattern. This tag is for version 2.0 specific questions. See also the main tag for general information about Knockout.js.

Version 2.0 of Knockout.js as announced by its creator included the following new features:

  1. Control flow bindings such as if, ifnot, with, and foreach;
  2. Containerless control flow, e.g. <!-- ko foreach: products -->;
  3. Access to parent binding contexts through contextual variables such as $parent;
  4. Cleaner event handling using the click binding;
  5. Binding providers (and hence external bindings)
  6. Throttling by extending observables.

Find the v2.0.0 source on GitHub.

1009 questions
0
votes
1 answer

Knockoutjs Cascading dropdown using the Mapping plugin: undefined reference error

I'm attempting to create a cascading dropdown based on the Knockout.js Cart example but with the Mapping plugin to get my data. I've got the mapping plugin working fine, a template working fine, the first select is good but getting an error on the…
Andrew Grothe
  • 2,562
  • 1
  • 32
  • 48
0
votes
2 answers

With KnockoutJS, how do you specify the ViewModel to bind to?

It's a pretty simple question, so I'm really hoping for a simple solution. I don't want to use any of the external templating libraries, because whilst I am familiar with EmberJS, Ember would be overkill for the application I'm currently working…
Wildhoney
  • 4,969
  • 33
  • 38
0
votes
1 answer

KO: Does the "Throttle" extender reduce the usefulness of a PausableComputed?

Like many others Knockout developers before me, I encountered a “slow running script” warning in IE. Before profiling my client-side script, I wanted to see how others solved similar problems. [Incidentally, here was the best Knockout profiling…
Jim G.
  • 15,141
  • 22
  • 103
  • 166
0
votes
1 answer

knockout validation errors for observables inside array objects

I'm using the Validation library [Knockout Validation][1] with Knockout 2. Although the UI displays validation error correctly for observable properties inside the array of objects. The ko.validation.group function does not track these errors. …
Pablo
  • 2,376
  • 5
  • 26
  • 34
0
votes
1 answer

Knockout.js getting element from json object and extracting into array

I have the following line: $.getJSON('@Url.Action("RegistrationShareClassReport", new { id = ViewBag.Id })', function (data) { viewModel.RegistrationShareClassReport(data); }); This basically returns data in json format with different…
tjhack
  • 1,022
  • 3
  • 20
  • 43
0
votes
1 answer

Rookie starting knokout questions

I just started reading, and go through some knokout tutorial, and really like it, but Cannot make a simple sample by myself. Here is HTML code
Frenchi In LA
  • 3,139
  • 3
  • 25
  • 41
0
votes
1 answer

Knockout Js observable Array Jquery Events

Using Knockout JS 2.0 with jQuery 1.7.2 I am having an issue with live (on) events with objects created by my observableArray. if I change the target of my function to a dom element that is on the page already it works, however when targeting an…
Brett Smith
  • 2,992
  • 1
  • 20
  • 22
0
votes
1 answer

Two controls bound to the same knockout observable property causes errors

I am trying to write a bit of UI that allows the user to either enter a number via a textbox or pick an option from a drop down. I have made a simplified jsFiddle at http://jsfiddle.net/unklefolk/PNQeR/2/ As you can see: When "The number" is…
Mark Robinson
  • 13,128
  • 13
  • 63
  • 81
0
votes
2 answers

knockout.js: pass { data: xyz } to foreach instead of just xyz

I'm just getting started with knockout.js. I have a foreach binding like this, which works fine:
  • ....
people is part of my model that I pass to ko.applyBindings. According to the documentation,…
Achim
  • 15,415
  • 15
  • 80
  • 144
0
votes
1 answer

provide index on click with knockout repeat

I'm trying to provide a number of clicked link to click handler. For some reason it provides the whole knockout model, instead of the $index. Here's jsfiddle: http://jsfiddle.net/yaroslavya/hfWs8/13/
Yaroslav Yakovlev
  • 6,303
  • 6
  • 39
  • 59
0
votes
2 answers

knockoutJS causing stop script errors with nested foreach

I'm using knockout.js to render my view, I'm getting the data from the server and binding like this.. var viewModel = ko.mapping.fromJS(data); ko.applyBindings(viewModel, $("#macro-wrapper")[0]); My view...I've trimmed a few bits out...but binding…
SteveCl
  • 4,529
  • 6
  • 29
  • 38
-1
votes
1 answer

Grouping a list by a property

Hi i am trying to do a table grouping of a list of class. I am following the code at this page The issue I have is with this line
    In my case it doesnt recognize type well in my case…
Jseb
  • 1,926
  • 4
  • 29
  • 51
-1
votes
1 answer

Bootstrap timepicker Knockout js binding handler

Knockout js binder for twitter bootstrap timepicker. click here for timepicker plugin
-1
votes
1 answer
-1
votes
1 answer

Knockoutjs foreach n rows check if dropdown has value

I have this html markup: