iOS UIWebView에 사용자 정의 HTML 페이지가 내장되어 있습니다. 페이지를 경로로로드 한 다음 모든 스크립트가 페이지에로드되고 모든 것이 잘된 것처럼 보입니다. 하나만 제외하고 버튼의 "활성화 된"상태. Chrome 및 Safari에서 100 % 작동하지만 UIWebView에 삽입 된 후에는 버튼을 누를 때마다 새로 고침되지 않습니다. 하지만 필드를 클릭하면 바인딩 함수가 호출되는 것 같습니다. Kendo documentation에 지정된대로 "사용 가능"바인딩을 사용했습니다.iOS UIWebView의 Kendo MVVM
* Working sample here.
<div class="gui-header-section k-content">
<h1>Test</h1>
</div>
<div id="recolteInfoDiagnostic">
<div id="section1" data-bind="visible: isSectionVisible(1)">
<div class="gui-form-section k-content">
<div>
<form>
<ul class="fieldlist">
<li>
<label for="fname">First name</label>
<input id="fname" data-bind="value: firstNameSousc" class="k-textbox" /></li>
<li>
<label for="lname">Last Name:</label>
<input id="lname" data-bind="value: lastNameSousc" class="k-textbox" /></li>
<li>
<label>Gender:</label>
<select id="cbxGenderSousc" data-bind="source: gendersDataSource, value: genderSousc"></select></li>
<li>
<label for="agree">License Agreement</label>
<input type="checkbox" id="agree" data-bind="checked: agreed" />
I have read the licence agreement</li>
</ul>
</form>
</div>
</div>
<div class="gui-form-section k-content">
<div>
<!-- Some content, ommited for clarity -->
</div>
</div>
</div>
<div id="section2" data-bind="visible: isSectionVisible(2)">
<div class="gui-form-section k-content">
<!-- Some content, ommited for clarity -->
</div>
<div class="gui-form-section k-content">
<!-- Some content, ommited for clarity -->
</div>
</div>
<div id="navToolBar" class="gui-header-section k-content">
<div>
<button data-bind="enabled: isBackEnabled, click: back" class="k-button k-primary">Back</button>
<button data-bind="enabled: isNextEnabled, click: next" class="k-button k-primary">Next</button>
</div>
</div>
</div>
그리고 그것과 함께가는 자바 스크립트 : 당신이 아이 패드에 사파리를로드하는 경우에는 문제가 여기에
내 HTML의 샘플입니다 볼 수 있습니다
$(document).ready(function() {
var kendoViewModel = kendo.observable({
formID: "informationsDiagnostic",
visibleSectionNo: 1,
totalPageNumber: 2,
firstNameSousc: "",
lastNameSousc: "",
genderSousc: "",
agreed: false,
gendersDataSource = new kendo.data.DataSource({
data: [
{ text: "Male", lang: "en", value: "M" },
{ text: "Female", lang: "en", value: "F" }
]
}),
isBackEnabled: function() {
return !(this.get("visibleSectionNo") === 1);
},
isNextEnabled: function() {
return !(this.get("visibleSectionNo") === this.get("totalPageNumber"));
},
next: function (e) {
e.preventDefault();
this.set("visibleSectionNo", this.get("visibleSectionNo") + 1);
},
back: function (e) {
e.preventDefault();
this.set("visibleSectionNo", this.get("visibleSectionNo") - 1);
},
isSectionVisible: function(pageNumber) {
return (pageNumber === this.get("visibleSectionNo"));
}
});
$("#cbxGenderSousc").kendoDropDownList({
dataSource: gendersDataSource,
dataValueField: "value",
dataTextField: "text"
}).data("kendoDropDownList");
kendo.bind($("#recolteInfoDiagnostic"), kendoViewModel);
을});
"visible"속성의 데이터 바인딩이 제대로 작동하지만 "enabled"속성에서 제대로 작동하지 않는다는 것에 유의하십시오. 양식의 다른 모든 바인딩은 OK입니다.