Create a basic Grid using KnockoutJS Mapping plugin and MVC 3
Create a basic Grid using KnockoutJS Mapping plugin and MVC 3
This answer gives the details of using the mapping plugin and mvc for doing the basic grid .
As the request is done irregularly , The $.getJSON want the user to transfer the callback to deal with the result ,.
So, Try this example code :
var viewModel = {}; $.getJSON('WeightTracker/List', function(result) { viewModel.stats = ko.mapping.fromJS(result.Data); ko.applyBindings(viewModel); });
From the above consideration,Its is better to be binding in the following way .
<tbody data-bind='template: {name: "statRowTemplate", foreach: stats }'></tbody>
The process is done with a JavaScript object and not a JSON string during doing the $.getJSON