저는 jQuery AJAX에 대해 매우 잘 알고 있으며 항상 사용하고 있습니다. Kendo UI는 jQuery와 AJAX를 사용하여 만들어졌습니다. 사용Kendo UI를 사용하여 HttpHandler에 매개 변수를 전달하는 방법은 무엇입니까?
JQUERY AJAX : HttpHandler를에 & 통과 매개 변수와 인터페이스하는 jQuery를 사용하여 쉽게, 당신은 단순히 다음을 수행
$.ajax({
complete: self.onComplete,
data: { SiteId: 777 }, // <--- this gets appended to the post
dataType: 'json',
error: self.onError,
success: self.onSuccess,
url: self.url
});
내 문제 : 나는을 찾기 위해 노력하고
KendoUI 상당액은 data
(위)입니다.
- 격자 파라미터가 HttpHandler를 공급되고 있지 않은 HttpHandler를
- 나를 다시 전달 데이터로 채우는 않지만
검도 CODE 모습 (아래 참조)
<script type="text/javascript">
$(document).ready(function() {
var dataSource = new kendo.data.DataSource({
transport:
{
read: {
url: "Handlers/Attempt1Synch.ashx",
dataType: "json",
contentType: "application/json; charset=utf-8",
type: "POST",
data: { SiteId: 777 }
}
// parameterMap: function (data, operation) {
// return JSON.stringify(data);
// }
},
schema: { data: "People" }
});
$("#grid").kendoGrid({
height: 360,
width: 500,
dataSource: dataSource,
groupable: true,
scrollable: true,
sortable: true,
pageable: true,
columns:
[{
field: "Id",
width: 0
},
{
field: "FirstName",
width: 90,
title: "First Name"
},
{
field: "LastName",
width: 90,
title: "Last Name"
},
{
width: 100,
field: "City"
},
{
field: "Title"
},
{
field: "BirthDate",
title: "Birth Date",
template: '#= kendo.toString(BirthDate,"dd MMMM yyyy") #'
},
{
width: 50,
field: "Age"
}]
});
});
</script>
<div id="grid">
</div>
MY HTTP 핸들러는 다음과 같습니다
public class Attempt1Synch : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
var siteId = Convert.ToInt32(context.Request["SiteId"]);
var serializer = new JavaScriptSerializer();
var response = mock(siteId);
context.Response.ContentType = "text/json";
context.Response.Write(serializer.Serialize(response));
context.Response.End();
}
public bool IsReusable
{
get
{
return false;
}
}
}
consise answer를 주셔서 감사합니다. Kendo UI에서 블로그 또는 자습서를 사용 하시겠습니까? Telerik의 설명서와 예제가 부족합니다. –
아니요, '시행 착오'를 통해이를 극복해야만했음을 유감스럽게 생각합니다. 그리고 네, Telerik의 문서화 사이트는 짜증납니다. –