I am using MVVM .I am getting in but items are not getting rendered in .
@model Rezcue.ViewModel.CustomerRequest.AirRequestMVVM
<div id="AirRequestFormContainer" data-Template="AirRequestTemplate" data-bind="source: AirItem">
</div>
<script type="text/javascript">
var AirRequestViewModel = null;
$(document).ready(function() {
debugger;
AirRequestViewModel = kendo.observable({
AirItem: {
AirVMList: @Html.Raw(Json.Encode(Model)),
FlightStopsSource: new kendo.data.DataSource({
transport: {
read: {
url: rootUrl("GetData/GetCountry"),
dataType: "jsonp"
}
},
serverFiltering: true,
}),
OnOpenOriginAutoComplete: function(e) {
debugger;
var target = $(e.sender.element).data("kendoAutoComplete");
target.list.width(280);
},
AddSegment: function(e) {
debugger;
},
resizeFlightStop: function(e) {
debugger;
//var target = $(e.sender.element).data("kendoDropDownList");
//target.list.width(280);
},
ResetAirItem: function(e) {
debugger;
},
ToggleCollapseSegment: function(e) {
debugger;
},
SaveAirSegment: function(e) {
debugger;
}
}
});
LoadTemplateNew("Content/Templates/AirRequestViewModel.tmpl.htm");
});
function loadAirRequestBinder() {
kendo.ui.progress($("body"), true);
kendo.bind($("#AirRequestFormContainer"), AirRequestViewModel.AirItem);
loadKendoWindow("#AirRequest", "Create Air Request");
kendo.ui.progress($("body"), false);
}
$(document).bind("TEMPLATE_LOADED", function (e, path) {
kendo.ui.progress($("body"), true);
debugger;
loadAirRequestBinder();
kendo.ui.progress($("body"), false);
});
</script>
TEMPLATE CODE:
<script id="AirRequestTemplate" type="text/x-kendo-template" class="KendoExtTemplate">
<div data-bind="source: AirVMList" data-Template="airitemtemplate" ></div>
</script>
<script id="airitemtemplate" type="text/x-kendo-template" class="KendoExtTemplate">
<div data-bind="source: SegmentInfo" data-Template="SegmentTemplate" > </div>
</script>
<script id="SegmentTemplate" type="text/x-kendo-template" class="KendoExtTemplate">
<div>
<label style="width:37px;">From </label>:
<input data-role="autocomplete"
data-placeholder="Search"
data-value-primitive="true"
data-text-field="Code"
data-bind="value: Origin,
source: FlightStopsSource"
style="width: 100%;" />
</div>
</script>
JSON RESPONSE :
[{"Code":"BOM","Name":"\u003ci class=\"fa fa-plane\" style=\"color:#2885D1;\"\u003e\u0026nbsp;\u003c/i\u003e\u003cspan style=\"font-size:.9em\"\u003e\u003cspan style=\"font-family:courier new,courier,monospace;\"\u003e[\u003cspan style=\"color:#2885D1;\" \u003e\u003ca href=\"http://maps.google.com/maps?q=19.088611,72.868056\" target=\"_blank\"\u003eBOM\u003c/a\u003e\u003c/span\u003e]\u003c/span\u003e\u0026nbsp;Mumbai,\u0026nbsp;India \u003cbr /\u003e \u003cspan style=\"font-style:italic;color:#808080\"\u003eMumbai\u003c/span\u003e\u003c/span\u003e","City_code":"BOM","City_Name":"Mumbai","Country_code":"IND","Country_name":"India"},{"Code":"BMH","Name":"\u003ci class=\"fa fa-plane\" style=\"color:#2885D1;\"\u003e\u0026nbsp;\u003c/i\u003e\u003cspan style=\"font-size:.9em\"\u003e\u003cspan style=\"font-family:courier new,courier,monospace;\"\u003e[\u003cspan style=\"color:#2885D1;\" \u003e\u003ca href=\"http://maps.google.com/maps?q=-6.366667,144.633333\" target=\"_blank\"\u003eBMH\u003c/a\u003e\u003c/span\u003e]\u003c/span\u003e\u0026nbsp;Bomai,\u0026nbsp;Papua New Guinea \u003cbr /\u003e \u003cspan style=\"font-style:italic;color:#808080\"\u003eBomai\u003c/span\u003e\u003c/span\u003e","City_code":"BMH","City_Name":"Bomai","Country_code":"PNG","Country_name":"Papua New Guinea"},{"Code":"BOA","Name":"\u003ci class=\"fa fa-plane\" style=\"color:#2885D1;\"\u003e\u0026nbsp;\u003c/i\u003e\u003cspan style=\"font-size:.9em\"\u003e\u003cspan style=\"font-family:courier new,courier,monospace;\"\u003e[\u003cspan style=\"color:#2885D1;\" \u003e\u003ca href=\"http://maps.google.com/maps?q=-5.866667,13.066667\" target=\"_blank\"\u003eBOA\u003c/a\u003e\u003c/span\u003e]\u003c/span\u003e\u0026nbsp;Boma,\u0026nbsp;Congo, the Democratic Republic of the \u003cbr /\u003e \u003cspan style=\"font-style:italic;color:#808080\"\u003eBoma\u003c/span\u003e\u003c/span\u003e","City_code":"BOA","City_Name":"Boma","Country_code":"COD","Country_name":"Congo, the Democratic Republic of the"},{"Code":"LAZ","Name":"\u003ci class=\"fa fa-plane\" style=\"color:#2885D1;\"\u003e\u0026nbsp;\u003c/i\u003e\u003cspan style=\"font-size:.9em\"\u003e\u003cspan style=\"font-family:courier new,courier,monospace;\"\u003e[\u003cspan style=\"color:#2885D1;\" \u003e\u003ca href=\"http://maps.google.com/maps?q=-13.266667,-43.416667\" target=\"_blank\"\u003eLAZ\u003c/a\u003e\u003c/span\u003e]\u003c/span\u003e\u0026nbsp;Bom Jesus da Lapa,\u0026nbsp;Brazil \u003cbr /\u003e \u003cspan style=\"font-style:italic;color:#808080\"\u003eBom Jesus da Lapa\u003c/span\u003e\u003c/span\u003e","City_code":"LAZ","City_Name":"Bom Jesus da Lapa","Country_code":"BRA","Country_name":"Brazil"},{"Code":"GMM","Name":"\u003ci class=\"fa fa-plane\" style=\"color:#2885D1;\"\u003e\u0026nbsp;\u003c/i\u003e\u003cspan style=\"font-size:.9em\"\u003e\u003cspan style=\"font-family:courier new,courier,monospace;\"\u003e[\u003cspan style=\"color:#2885D1;\" \u003e\u003ca href=\"http://maps.google.com/maps?q=-1.933333,15.866667\" target=\"_blank\"\u003eGMM\u003c/a\u003e\u003c/span\u003e]\u003c/span\u003e\u0026nbsp;Gamboma,\u0026nbsp;Congo \u003cbr /\u003e \u003cspan style=\"font-style:italic;color:#808080\"\u003eGamboma\u003c/span\u003e\u003c/span\u003e","City_code":"GMM","City_Name":"Gamboma","Country_code":"COG","Country_name":"Congo"}]