I\'m new to Knockout.js and I\'m trying to display data from observable array to a table.
The problem I have is it generates two tbody tags. But if
Actually, your html markup is fine. I added the following javascript to your markup
$(document).ready(function() {
var a = [{
permit: "permit1",
region: 'region1',
landowner: 'landowner'},
{
permit: "permit2",
region: 'region2',
landowner: 'landowner2'}];
var vm = {};
vm.requestList = ko.observableArray([]);
ko.applyBindings(vm);
$('#loadData').click(function() {
var a1 = ko.mapping.fromJS(a);
var b1 = a1();
vm.requestList(b1);
});
});
And it seems to be working as you describe how you want things to work. It is working at http://jsfiddle.net/photo_tom/xmk3P/10/