i work with knockout, i have an observablearray (mappedCompaignByInterest) in my viewmodel that contains array of object, each object is like dictionary, it contain key that is string and the value that is an array of object(Compaign). please how can i bind this object with table on knockoutjs .
here is my viewmodel :
function DashboardViewModel() {
var self = this;
self.BuzzCompaignByInterest = ko.observableArray([]);
}
and this is for loading data from server
// Load initial state from server,
$.getJSON("/Dashboard", function (Data) {
var mappedCompaignByInterest = Data.BuzzCompaignByInterest;
self.BuzzCompaignByInterest(mappedCompaignByInterest);
});
note that Data.BuzzCompaignByInterest wish i get it from server is a dictionary , the key is a string and the value is an array of object(Compaign) here is the propertie of class Compaign :
public class BuzzCompaignModel
{
public long BuzzCompaignId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
please how can i display data from BuzzComapignByInterest(observablearray in viewmodel)