0
votes
0answers
13 views

knockout foreach nested in a with

I want to bind a simple structure with ko but I am getting an exception during binding. My VM looks like this: function VM() { this["longNameObjId1"] = new Object(); ...
0
votes
1answer
51 views

refactoring anonymous function javascript

I am working on knockout bindings.. I have knockout sorting to implement and i have done this way.. function notesViewModel() { _this.colName = "CreatedDate"; _this.sortOrder = "desc"; ...
0
votes
1answer
14 views

Validate observables within a collection using Knockout Validation

I have a message field and collection of people being bound in an unordered list accompanied each with a drop down list of colors and a default selection. Validation on the message field works, erase ...
1
vote
2answers
27 views

How to load a JS lib that defines a global and depends on another 3rd party lib using RquireJS?

I am trying to load KnockoutFire, a KnockoutJS plugin using RequireJS. It is only 1 file: https://github.com/hiroshi/knockoutFire/blob/master/knockoutFire.js The plugin does two things: Defines the ...
0
votes
2answers
33 views

Knockout how to print a value from another lookup table

I have an object that I like to read it's value from another observableArray as a lookup. here is a link to it http://jsfiddle.net/928FQ/. I have a select list that is populated correctly and it's ...
1
vote
2answers
21 views

Checkboxes binding to two objects with Knockout

I'm creating a checkbox list. The list is created from this object: this.definedRoles = ko.observableArray([]); But another object has which boxes should be checked. this.userToAdd = { ...
0
votes
1answer
28 views

Load selected values in dropdown on selecting value from another dropdown

I have 2 dropdowns. When i select value from one dropdown it will load values in another dropdown depending upon what is selected. Here is my html code <select data-bind="options: filters, value: ...
0
votes
1answer
27 views

Custom onclick function as property in Knockout SimpleGrid

I'd like to display a value within data as a link, and pass a custom function to it's click event (which will eventually display a modal w/ status history). I have properties "isLink" (bool) and ...
1
vote
1answer
32 views

Knockout observable subscribe doesn't recognize a change with date input in google Chrome

Weird issue with Knockout.js whereas it won't recognize the date has been selected after reset, but only with the same date. To replicate in my jsFiddle: http://jsfiddle.net/V5JCq/ follow these ...
0
votes
1answer
35 views

Knockout.js use foreach to display object properties

I have this Viewmodel to load the users and their list of Socialgraphs from WCF services. The users appear correct but no socialgraph entry appears. I have checked the service and json returned and ...
0
votes
1answer
32 views

Knockout not behaving correctly in Pyramid

I'm building a webapp using Pyramid, but Knockout is behaving differently. I have a form: <div data-bind="with: $root.itemToAdd" style="display: none;"> <form ...
0
votes
1answer
26 views

Reusing a knockout.js viewModel without using global variables

I have a page with different knockout generated content. I have a right menu with data that should load new data in the middle of the page depending the row chosen in the right menu. So, I can fetch ...
1
vote
1answer
33 views

Knockout JS will not update mapped object

I'm very new to Knockout JS. I haven't found much help through Google on mapping with knockout js. I have a JSON coming in from the server. I map the JSON with the knockout js mapping library. The ...
-1
votes
2answers
53 views

form reset button conflict with jquery reset

I encounter something weird. I have the following form: <form id="addExpenseForm" name="addExpenseForm" data-bind="submit: addExpense"> <input type="submit" value="Add" class="save" ...
0
votes
1answer
25 views

When to add extend additional complex types onto a Breeze entity

I want to load an entity from the database, and then using it's ICollection (from the model class) load up some child data. This would be simple enough to do from individual view models if it was a 1 ...
0
votes
2answers
42 views

Creating a autocomplete field with Typeahead in the Durandal Framework

I'm trying to achieve a autocomplete input field with typeahead (twitter bootstrap). This autocomplete field should be in a modal but I cant seem to get it working! It also must be observable with ...
0
votes
0answers
19 views

Durandal and JavaScript Strict Mode. How to get the instance to Knockout?

Durandal uses Knockout therefor the Knockout script needs to be loaded before Durandal. When using strict mode in JavaScript on my ViewModel the "ko" variable does not exist and gives me an error. I ...
2
votes
1answer
22 views

Knockout checkbox issue

I have a checkbox on which I want to bind a function that does something if the checkbox is checked and something if the checkbox isn't checked. But the checkbox won't stay checked. It is checked ...
0
votes
0answers
23 views

How to fix jquery mobile 1.3.0 preventing changepage method when combined with Knockout click bind

Since i updated jquery mobile to the newest version, 1.3.0 my links in listviews don't work anymore. I figured out that the problem is knockoutJS after trying it without this line. data-bind="click: ...
0
votes
1answer
45 views

Strange knockout js select option binding issue

Does anybody have a minute to take a look at a puzzling problem I'm having with Knockout JS and binding select lists? The person's favourite color should be selected in the list by calling value: ...
0
votes
2answers
39 views

Javascript Knockout, finding property name from the value

I have two buttons, to sort which sort by player name and id. iam using two function for each of the sort like. <ul data-bind="template: { name: 'playerstmpl', foreach: players }"></ul> ...
0
votes
1answer
13 views

Knockout template binding using button

Iam learning knockouts and I came across this example.. <h2>Not sorted</h2> <ul data-bind="template: { name: 'instanceTmpl', foreach: instances }"></ul> <hr/> ...
1
vote
1answer
33 views

Setting the initial value of a select with KnockoutJS

I'm having trouble getting a select to populate with the initial value of a property in an object. I have a Location object that has a property which is a collection of urls. { id: 1, name: ...
0
votes
1answer
25 views

Enumerating observableArray in knockout casting to string? [duplicate]

Again, seems like a brain fart on my side. Trying to make sample operation by looping through all of the objects in array and changing observable property on those objects: var sss = vm.tripData(); ...
0
votes
0answers
46 views

Adding a row to an observable array binded to a Viewmodel

I have a table displaying results binded from a an initial viemodel. When I click on a row, i have a click event that goes into a second viewmodel. I want to take the results of every item clicked ...
2
votes
1answer
53 views

learning the mechanics of knockout.JS

Im using MVC and I am trying to use the introduction tutorials on http://learn.knockoutjs.com/#/?tutorial=intro I would like to implement them in Visual studio though. Im not exactly sure how to do ...
0
votes
2answers
31 views

Knockout.js modify value before ko.observable() write

I've got a working viewmodel with numerous variables. I use autoNumeric (http://www.decorplanit.com/plugin/) for text formatting in textbox. I'd like to use the input field's observed data in a ...
0
votes
1answer
28 views

How can I update mapped inner arrays in Knockout without updating the number of array objects in the main array?

I'm working on a stock watcher site that automatically updates stock prices through AJAX. With this I've decided to use knockout.js to be able to automatically update the UI of the site when the ...
0
votes
2answers
55 views

Ajax loaded data doesn't update layout

I load data using ajax and populate my page using Knockout. This all works great, when I changes pages to #contacts it looks good. However, I have a problem when the #contacts page is the initial page ...
-1
votes
0answers
32 views

How to display Kendo UI Treeview in the Hot SPA Towel template [closed]

Hi I am new using SPA application and i would like know how to apply treeviewcontrol from kendoUI to the SPA towel template. Any advice.. as far i know there no much tutorial or link related with the ...
0
votes
0answers
27 views

Jquery knockout dynamic template not working

I have a view model: function ViewModel() { this.applications = ko.observableArray(); this.templateView = ko.observable("application-grid"); this.templateToUse = function () { ...
1
vote
0answers
24 views

Is it possible to have a cell of type object in a wijgrid?

I use a KnockOut observable array to populate a wijgrid. In the wijgrid, I'd like to use a JavaScript object as the value of some cells. Unfortunately, it seems as though wijmo converts objects to ...
1
vote
1answer
50 views

Reusable property validation with knockout

I have the following class which validates the name and doesn't let the user put an empty name. With it I can get the valid value and notify the user if the input is invalid (preserving the last good ...
1
vote
1answer
44 views

CakePHP GET request failing only part of the time

I'm having a strange situation and I'm not quite sure where to start looking. I have a knockout.js form on the front end, and CakePHP in the backend. As of right now, I send some JSON data from a ...
0
votes
1answer
25 views

Pass multiple values/observables to custom binding

I'm doing a simple custom binding which accepts a plain observable and adds the value of the observable to the bound element's css class list, like so: <div class="container" ...
0
votes
1answer
35 views

Getting data from an object inside an object

Hi I am just learning knockout and I am facing a problem that I can not seem to understand. I have this object: var studentPersonalDetails = ko.observable(); var isInitialized = false; ...
-2
votes
1answer
40 views

Best practices multiple field validation with KnockoutJS

I am looking for the best practices for practices multiple field validation. Say I have two number input for min and max. Where and how can I implement the logic checking min must <= max ? Thanks!
1
vote
4answers
117 views

Knockout.js modifying an item with multiple locations in the viewmodel (aka: a 1-many relationship)

Using Knockout.js: If an item/object is located within a viewmodel in more than one location (same exact object), is it possible for both items to be bound together so that if the user edits the item ...
-1
votes
0answers
29 views

how to share knockoutJS viewmodel cross pages?

I built a viewmodel object in my app, with knockJS. my app is built with few html pages and each page is filling diffrent attributes of my viewmodel , at the end of the flow i will generte my ...
0
votes
1answer
49 views

Reactive http requests in JavaScript

Sorry for my English. I made some test client for test our web server, but I am unhappy with my work. Please help me improve my code. I want to make serial HTTP requests. I have Array with test ...
0
votes
1answer
43 views

Value of this in a Durandal view model

I have a problem that is baffling me at the moment. I have a Durandal view model defined as below but the value of this and other variables and functions as I step through the code chops and changes ...
1
vote
1answer
24 views

Can I access $data within a jquery call in an if-binding in Knockoutjs?

I have a foreach binding and I want to display and item only if it is not already on the page, I seem unable to reference the current element within jquery <tbody data-bind="foreach: fixtures"> ...
0
votes
1answer
23 views

Knockout Can I get around this computed loop?

I have the following structure for a bunch of objects in my viewmodel I have an underlying array filled with objects that have ko.observable items in. Ex: selections = ...
0
votes
0answers
50 views

Pass a function that returns the value of the ko.computed error during submit

I'm having trouble submitting a form with knockout js. I receive the error "Pass a function that returns the value of the ko.computed." The code is as follows: (function(records,$,undefined){ ...
1
vote
2answers
41 views

How to specify different click bindings in a foreach loop with KnockoutJS

I have a knockout observable array of the form: this.controls = ko.observableArray([ { name: 'Previous', action: '$root.previous' }, { ...
1
vote
2answers
25 views

Knockout how add custom column to table during foreach

Hello I need to build in dynamic table with columns(header) from array and rows from other array, first column in array must be static. <table> <thead> <tr> ...
0
votes
2answers
37 views

nested this is pointing to the wrong variable

In the class below The this in new SeatReservation("Steve", this.availableMeals[0]), is refering to inside seats , How do I make it refer to the correct one availableMeals Can I go new ...
0
votes
1answer
50 views

This template engine does not support the 'if' binding within its templates

In the code below the error happens in this template when I added the 'if' to the bind Is this fixable as I only want it to bind when its visible? Thanks <script id="friendsTemplate" ...
1
vote
2answers
37 views

Building pagination controls with Knockout.JS

I've inherited a project which uses Knockout.JS to render a listing of posts. The client has asked that this listing be paginated and I'm wondering if this is possible and appropriate using ...
0
votes
2answers
45 views

knockout example template example not working

In the following code why does the jquery template not render? I thought that the template was build in? thank you <script id="friendsTemplate" type="text/html"> <ul> ...

1 2 3 4 5 38
15 30 50 per page