Search Results

Search found 1 results on 1 pages for 'user1574860'.

Page 1/1 | 1 

  • Issue with ko.observableArray

    - by user1574860
    I am using Knockout plugin. The following is my code. In this i am making getting the ceremony list from the server and then save that list in the array. But the problem is in IniitialCallForCeremonies(). The array is not initializing with the returned array from IniitialCallForCeremonies() function. function CeremonyViewModel() { var self = this; self.Ceremonies = ko.observableArray(InitialCallForCeremonies()); } $(document).ready(function () { ko.applyBindings(new CeremonyViewModel()); }); function InitialCallForCeremonies() { var request = $.ajax({ url: "address", type: "GET", async: false, dataType: "JSON" }).success(function (data) { var tempArray = new Array(); $.each(data, function (index, value) { tempArray.push(new Ceremony(value)); }); return tempArray; }); } function Ceremony(val) { this.Id = val.Id; this.Event = val.Event; this.Date = val.Date; this.Guest = val.Guest; }

    Read the article

1