빠른 회귀 테스트를 위해 모든 KendoUI 항목이 올바르게 구성되고 초기화되었는지 확인할 방법을 찾고 있습니다. 비 기존의검도 UI 값 바인딩 오류 감지
- 소스 결합 : 값 결합 경로가 정말 다음 예제 즉 모델에 존재하지 않을 때 나는 상황을 감지 할 수없는 경우
나는 문제에 직면 그러므로 내가 보장 할 수없는있다 - 재산
data-bind="source: AnotherNonExistingProp"
오류Uncaught TypeError: Cannot read property 'parent' of undefined
(그래서 콘솔에서이를 감지 할 수 있습니다) - 그러나, 값 결합 하지 던져 오류가 않습니다 존재하지 않는 특성
data-bind='value: Details.NonExistingProp'
에를 던졌습니다 회귀.
HTML :
<form>
<div>
<label>Name<label>
<input data-bind='value: Name' type='text' />
</div>
<div>
<label>Age<label>
<input data-bind='value: Details.NonExistingProp' type='text' />
</div>
<table border='1px' data-template="row-template" data-bind="source: anotherNonExistingProp">
</table>
</form>
자바 스크립트 :
<script type='text/javascript'>
$(function() {
var carModel = kendo.observable({
Name: 'CarName',
Details: {
Age: 25
},
Parts: [{PartName:'aa'},
{PartName:'bb'}]
});
kendo.bind($('form'), carModel);
})
</script>
값 결합이 존재하지 않는 경로를 사용할 때 상황을 감지 할 수있는 방법이 있나요 (즉 재산에 의해 대상 경로가 정의되지 않았습니다)? 당신이 모두를 얻고 싶다면 여기
라이브 jsFiddle example
감사합니다! 두 번째 방법은 시원합니다. 나는 성능에 대해별로 걱정하지 않는다. 왜냐하면 나는 이것을 통합 테스트 환경에서만 실행할 것이기 때문이다. – Isantipov