Questions tagged [knockout-viewmodel-plugin]

Knockout Viewmodel JavaScript plugin is a fast small, clean, flexible way to create a knockout view model.

The Knockout Viewmodel Plugin allows you create complex observable viewmodels easily and with more structure and control than ever before.

10 questions
2
votes
1 answer

extending ko.viewmodel on each array element fails

I can create a View Model such that an array of clickable div's, with favorite/nonfavorite type icons, works correctly. I use knockout to bind the css style, which has the appropriate background image set. The Favorite function is this: function…
Spero Larres
  • 387
  • 4
  • 10
2
votes
2 answers

How can I map a field computed using ko.viewmodel

Do not know how I can map a field computed using ko.viewmodel anyone knows how it's done? much appreciate any help. var model = { firstName: "Le gatêau", lastName: "Chien", items: ['J-Rock', 'J-Pop'], itemselected: 'J-Pop', all:…
kintaro
  • 1,543
  • 2
  • 12
  • 16
0
votes
1 answer

How to generically hook up dependent drop-downs with knockout

I have a json structure like the following: var scenario = { paints: [ { product: 'Super Paint', sheens: [ { sheen: 'Satin', cost: 42 }, { sheen: 'Semi-Gloss', cost: 50 } …
Danno
  • 913
  • 3
  • 15
  • 28
0
votes
1 answer

How to bind to an input element using a view model created by the knockout.viewmodel plugin

I'm using knockout with the knockout.viewmodel plugin. http://coderenaissance.github.io/knockout.viewmodel/ // JavaScript // data variable is loaded from an ajax call /* var data = { simple: { friendlyText: "Hello World" }…
Danno
  • 913
  • 3
  • 15
  • 28
0
votes
1 answer

Boostrap Modal resetting KnockoutJS nested ViewModels variables

I am new to Knockout JS and have come across an issue when using it alongside bootstrap modals which I have been unable to resolve despite hours of research. Here's my issue: I'm working with nested view models and I've noticed that if I try to…
0
votes
1 answer

KnockoutJS: Function Scope Error

This code is in a KnockoutJS viewmodel: function myViewModel() { this.prop1 = ko.observable(123); this.prop2 = ko.observable("Hello"); .. .. } myViewModel.prototype.func1 = function() { alert(this.prop1()); //works…
iSofia
  • 962
  • 1
  • 11
  • 27
0
votes
1 answer

Calling between viewmodels (KnockOutJS)

I'm using KnockoutJS to develop a plugin based on viewmodels. Is there any way to access the functions and properties of another viewmodel running in the same application? Something like this: My view model: function myViewModel() { …
iSofia
  • 962
  • 1
  • 11
  • 27
0
votes
2 answers

How do you properly reference the viewModel in extended methods when using the knockout.viewmodel plugin?

I'm extending the viewModel. I need to implement the addEmployee method so that it properly references the viewModel. This is what I have thus far: JSON: {"Employees": [{"FirstName":"James", "LastName":"Bond", …
0
votes
1 answer

How do I extend a knockout viewmodel when using the knockout viewmodel plugin?

I'm using the knockout.viewmodel plugin (http://coderenaissance.github.io/knockout.viewmodel/) to generate my viewModels on the fly from JSON returned via WebAPI. I'm having an issue extending the viewModel though. Here's a sample of my test script:…
0
votes
1 answer

Knockout.js update a view model

On Page load I am converting a JSON data to view model like this var jsonField = '#' + '<% = hdnField.ClientID %>'; jsonModel= { availables: ko.observableArray([]) }; …
Rohith Nair
  • 1,052
  • 1
  • 17
  • 32