json 데이터가있는 URL에서 검도 표를 만들었습니다. 여기에 코드이며 (메신저 YII 프레임 워크 작업) ajax 호출 후 검도 그리드 다시로드
$('#grid').kendoGrid({
dataSource: {
transport: {
read: {
url: "http://localhost/CoreProcess/proceso/getusers",
dataType: "json",
},
update: {
url: "http://localhost/CoreProcess/usuario/uptdate",
dataType: "json"
},
destroy: {
url: "http://localhost/CoreProcess/usuario/delete",
dataType: "json"
}
},
pageSize: 10
},
pageable: {
refresh: true,
pageSizes: true,
buttonCount: 5
},
editable: "inline",
columns: [{ title: "Nombre", field: "NOMBRE" },
{ title: "Apellidos", field: "APELLIDOS"},
{ title: "Email", field: "EMAIL"},
{ command: ["edit", "destroy"], title: "Acciones"}],
});
지금 같은 페이지에 내가 PHP를 방법에 아약스 호출을 통해 데이터베이스에 새로운 데이터를 삽입하는 작은 형태를 가지고 작품을 좋아
$.ajax({
type: "POST",
url: "http://localhost/CoreProcess/proceso/agregarparticipantes/uuid/" + uuid,
data:
{
post_participante: participante,
post_apellidos: apellidos,
post_email: email,
},
success: function(result)
{
alert(result);
var dSource = $('#grid').data('kendoGrid').dataSource;
dSource.transport.options.read.url = "http://localhost/CoreProcess/proceso/getusers";
dSource.read();
}
});
데이터베이스에 새 레코드를 만드는 작업은 정상적으로 작동하지만 문제는 그 후에 새로운 정보가있는 표를 다시로드하려는 것입니다. 변경된 json URL을 다시 읽는 것입니다. 내가
$('#grid').data('kendoGrid').dataSource.read();
$('#grid').data('kendoGrid').dataSource.refresh();
그러나 아무것도 같은 많은 것들을 시도, 내가 검도와 멍청한 놈입니다 ... 사람이 나를 도울 수 있을까? 모두 고마워요
다시 URL을 설정할 필요가 없습니다. $ ('# grid'). 데이터 ('kendoGrid'). dataSource.read(); 작동해야합니다. 새 행이 데이터베이스에 삽입 되었습니까? –
예. 사이트를 다시로드하면 새 행이 눈금에 나타납니다. 도움을 주셔서 감사합니다 – sklapez