0
각도 및 일반 문자가있는 검도 UI를 사용하고 있습니다. 나는 Kendo UI와 Angular가 고통 스럽다는 것을 알고 있지만, 그렇게해야만한다. ...검도 UI 정렬 및 정렬 정렬
보기가 훌륭하게 작동하지만, change-Event의 배열에 액세스하고 변수의 배열을 재정렬하려면 존재하지 않습니다. 이것이 또 다른 범위 인 것으로 보인다. 따라서이 데모에서는 다음과 같은 경고가 나타납니다.
// Change Event
changed(e: kendo.ui.SortableEndEvent) {
console.log(e);
console.info(this.data);
// For Demo
if(this.data == undefined){
alert("Can not access Data Array");
return;
}
// swap
var oldElement = this.data[e.oldIndex];
this.data[e.oldIndex] = this.data[e.newIndex];
this.data[e.newIndex] = oldElement;
}
data = [
{ value: "Val 1" },
{ value: "Val 2"},
{ value: "Value 3"},
{ value: "Value 4"}
];
해결 방법이 있습니까? 배열에 액세스 할 수 있습니까? 주석 http://codepen.io/anon/pen/ozbRJA?editors=1010
'change' 이벤트는'Sortable' 위젯의 컨텍스트에서 호출 될 가능성이 큽니다. 'this. $ angular_scope.ctrl.data'와 같은 것이 작동 할 수도 있습니다. 불행히도 지금은 그것을 확인할 수 없습니다. – Philipp
그것은 매력처럼 작동합니다! 내 mainproject에서 나는'this. $ angular_scope. $ parent.ctrl.data'라고했지만, 괜찮습니다. 고맙습니다! – webdude