0
我將json從ajax傳遞到kendo模板,然後我需要在模板中設置我的輸入值。我想這樣的:將輸入值設置爲kendo模板
$.ajax({
async: false,
type: "POST",
url: "/Service/MyService.svc/GetTestObjects",
data: '{"objectID": ' + '"' + myVal + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
processdata: true,
success: function (msg) {
var template = kendo.template($("#myTemplate").html());
var templateView = template(msg.GetTestObjects);
$("#myContainer").html(templateView);
},
error: function (msg) {
console.log(msg)
}
});
<input id="myInput" class="form-control" value=#= data.Text_Value# />
,如果屬性包含多個單詞,模板設置只有第一......例如,如果TEXT_VALUE =「測試值」 ...的輸入值只有「測試」 ..
我試着在模板中的控制檯對象數據中打印並且沒問題。所以我不知道它有什麼問題。
任何人都可以幫我修復它嗎?