이제 kendo 내장 편집 윈도우 대신 사용자 정의 팝업 kendoWindow를 사용하여 그리드 데이터를 누설하려고 할 때 kendoui로 웹 앱을 개발하는 방법을 배우고 있습니다. 어떻게 원격 요청을 보낼 봉사, 그래서 난 this page에 공식 API 문서에서 답을 찾기 위해 노력하지만 새로운 문제가 추적 코드로, 쇼를 발생있다 : 그것은 설명하기위한 예입니다kendo 데이터 소스의 'options'매개 변수
<script>
var dataSource = new kendo.data.DataSource({
transport: {
read : function (options) {
/* implementation omitted for brevity */
},
update: function (options) {
// make JSONP request to http://demos.kendoui.com/service/products/update
$.ajax({
url : "http://demos.kendoui.com/service/products/update",
dataType: "jsonp", // "jsonp" is required for cross-domain requests; use "json" for same-domain requests
// send the updated data items as the "models" service parameter encoded in JSON
data : {
models: kendo.stringify(options.data.models)
},
success : function (result) {
// notify the data source that the request succeeded
options.success(result);
},
error : function (result) {
// notify the data source that the request failed
options.error(result);
}
});
}
},
batch : true,
schema : {
model: { id: "ProductID" }
}
});
dataSource.fetch(function() {
var product = dataSource.at(0);
product.set("UnitPrice", 20);
dataSource.sync(); makes request to http://demos.kendoui.com/service/products/update
});
</script>
원격 서비스에 HTTP 요청을하는 함수로 업데이트를 지정하는 방법
내 문제는 'options'매개 변수는 무엇입니까? 읽기 및 업데이트 기능으로 전달됩니다. 내가 찾은 유일한 단서는 transport.parametermap 함수의 매개 변수입니다. 그러나 그들 사이에 특정 관계가 있는지 확신 할 수 없으므로 누군가 나를 위해 설명해 주길 바랍니다.
리얼 덕분에 사용되는 코드입니다. 예, 제가 링크 된 문서에서 답변을 찾았습니다. – Beicai