자바 스크립트에서 인라인 편집 가능한 옵션이있는 KendoUI 그리드를 개발 중이며 클릭 이벤트를 발생시키고 서버 측 업데이트 이벤트에 데이터를 게시하는 업데이트 버튼을 만들 수 없습니다. 업데이트 버튼을 클릭해도 클라이언트의 표가 업데이트되지 않습니다.검도 UI 그리드 업데이트 버튼이 실행되지 않습니다.
누군가 내가 여기서 잘못하고있는 것을 지적 할 수 있기를 바랍니다.
답변에 jfiddle 링크가 지겨워서 작동하지 않아서 중복되지 않습니다. kendo UI grid update function wont fire
<div id="grid"></div>
@section Scripts{
<script type="text/javascript">
$(function() {
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "Home/GetPupilsAsJson",
dataType: 'json'
},
update: {
url: "Home/UpdatePupils",
dataType: 'json',
type: 'POST'
}
},
pageSize: 5,
autoSync: true
});
$('#grid').kendoGrid({
dataSource: dataSource,
editable: "inline",
pageable: true,
columns: [{
field: "Id",
title: "Id",
width: 150,
hidden: true
}, {
field: "Firstname",
title: "Firstname",
width: 150
}, {
field: "Lastname",
title: "Lastname",
width: 150
}, {
field: "DateOfBirth",
title: "DateOfBirth",
width: 150
}, {
field: "Class",
title: "Class",
width: 150
}, {
field: "Year",
title: "Year",
width: 150
},
{
command: ["edit"],
width: 150
}]
});
});
</script>
}
HomeController
public ActionResult GetPupilsAsJson()
{
return Json(GetPupils(), JsonRequestBehavior.AllowGet);
}
[AcceptVerbs(HttpVerbs.Post)]
[HttpPost]
public void UpdatePupils(Pupil p)
{
//never reach here
}
UpdatePupils에서 'Pupil p'매개 변수없이 시도해보고 거기에 도달했는지 여부를 알려주시겠습니까? – MustafaP
@MustafaP .. 당신이 제안한대로 지쳤으나 여전히 작동하지 않습니다. 사실, 내 문제는 업데이트 버튼이 클라이언트의 편집 필드를 닫지 않는다는 것입니다. 불행히도 래퍼에 대한 라이센스가없는 MVC 래퍼로 시도했지만 잘 작동합니다. – lawphotog
브라우저가'Developer Mode' 또는'inspection'에 있고 네트워크 트래픽을 확인한 경우, 요청이 진행되는 것을 볼 수있는 요청이 표시됩니까? 내 브라우저가'Home/UpdatePupils'를 호출하고 있습니까? – OnaBai