KnockoutJS is a JavaScript library used for data and event binding on web pages, using a MVVM pattern.

learn more… | top users | synonyms

1
vote
0answers
32 views

Knockout after-school implementation

Please provide some feedback. Example Repository JavaScript ...
0
votes
0answers
13 views

Knockout scrollTopPercentage custom binding

I've got a custom knockout binding for the scrollTopPercentage: ...
4
votes
1answer
68 views

Simple Tic-Tac-Toe App Using Knockout.JS

This is really the first full app I've written in JavaScript minus CSS styling which I plan on adding later. Are there any ways it can be improved? Any ways I can make it cleaner or easier to read? ...
1
vote
1answer
61 views

Customer ViewModel with optional JSON initialization parameter

I have a situation where I have a ViewModel: ...
0
votes
2answers
136 views

Display relevant contents if radio button is clicked using knockout.js

I have four radio buttons and I want to display relevant contents for each of them if they are clicked. I am using knockout.js for data binding. Is there a better way to write the if statement ...
0
votes
0answers
82 views

Make knockoutjs model simpler and avoid full observable array refresh

The form creates / updates /deletes a category. The category is simple: ID and name properties in backend (Laravel) model. UI: Clicking on a category enables "edit mode": I need 2 things here: ...
4
votes
1answer
92 views

UI for adding roles and modules to a user list

I have a small UI that involves adding roles and modules to a user database array. The interface works as is, no problem at all, but it seems to have a bit of 'duplicate' code that I was hoping I ...
2
votes
0answers
127 views

Assigning JSON object values to objects in a KnockoutJS setup

I am using this for in loop to loop through a JSON object and to assign the JSON object's value to my own object in a KnockoutJS setup. The JSON object looks like ...
12
votes
1answer
424 views

Simon Says in Javascript (with Knockout) - Playable Code Snippet

I resolved to do the whole thing with just vanilla Javascript as a challenge, but man, Knockout's binding and state management is just too easy. A tiny bit of callback hell to get all the flashing / ...
2
votes
1answer
102 views

Intersect knockoutjs observablearray using linqjs

I wrote a extender function to observableArray in knockout js. What I'm looking for is a way to extract the intersection records based on one property. This works well on smaller number of arrays, but ...
15
votes
2answers
595 views

Custom JavaScript validation using the factory / module patterns

I am in the process of diving a bit deeper into JavaScript development and am looking at some common language patterns (module, and factory in particular). In this code, my aim is to create a ...
5
votes
2answers
118 views

Select grand child in array knockout

I'm trying to select a grand child from an array in an array. If it was C# I would have wrote something like below ...
1
vote
1answer
145 views

Dealing with the need to pass the root view model down to the children

I tend to feel the need in my Knockout applications to pass along a reference of the root view model down to the sub view models. However, I don't like the fact that I then have a dependency that lies ...
2
votes
1answer
166 views

Custom text binding handler

I created this custom binding handler: ...
2
votes
0answers
123 views

Correct usage of an MVC pattern in web applictaion

I have a method in my controller (GetAllPatients/EnrollmentQueue) which does return the correct data (an array of ...
3
votes
3answers
61 views

Planning Poker Using Knockout

I am trying to build something similar to planning poker and am very new to Knockout and was wondering if anyone could help me improve on my very crude start? This is what I have so far: HTML ...
2
votes
1answer
130 views

Is this a correct knockout ViewModel setup?

This is my first time using knockout. I'm reading/writing a JSON file with a fair bit of nested data. I had no problem creating the ViewModel to just write to the file, but now that I'm reading the ...
5
votes
1answer
872 views

Prototype inheritance with Knockout observables

I'm trying to write a JavaScript library to allow inheritance with knockout. The fundamental problem when implementing inheritance in Knockout is that each Knockout observable is its own instance, ...
2
votes
1answer
1k views

Revert knockout model original state back on update cancel?

I am using knockout in my project. I have some models like EmployeeModel, ServiceModel etc which user can update. On UI I give ...
13
votes
3answers
7k views

Simple to-do list as a single page application

I've been doing a simple implementation of a to-do list to learn how to use Knockout.js. I would like a general review of what I've done so far (not much). It's my first application in JavaScript and ...
4
votes
1answer
2k views

Knockout custom binding

I've written a custom binding for KnockoutJS which renders <select> elements with <optgroup> children. When run, ...
4
votes
1answer
573 views

knockout binding handler for custom components

I am using a combination of knockoutJS and jQuery. I have a number of jQuery plugins which perform particular re-usable functions, such as a numeric spinbox. I have written a binding handler to ...
11
votes
2answers
2k views

Knockout.js binding 2D table with rowspan

The app I'm working on should allows it's users to create tables. I have a view in which users are able to create a table. They should be able to define here the table's columns. The columns that the ...
2
votes
1answer
110 views

Structuring objects for proper MVVM in Knockout

I'm working with knockout and am trying to stay true the MVVM structure and trying to make the objects have that dependency on each other. Model, ViewModel, Service definitions: ...
2
votes
1answer
66 views

Need suggestions to improve the code for an open source web based drafting application

My application. The repository and the file that needs review. Here is the source code ...
4
votes
1answer
3k views

Two Knockout computed dependent on each other

I have 3 fields: Net Price (ex. tax) tax amount Total price (price ex. vat + tax amount) The NetPrice and the Total are ...
4
votes
2answers
908 views

How to enhance the readability of JavaScript part?

There is no doubt that Knockout.js is a very useful tool, which will save you from a lot of JavaScript (jQuery) binding hassle, which will reduce your team's bug ratio concerning this part. But ...