I have created a kendo grid that reads from a url with json data. Here is the code and it works ok
$('#grid').kendoGrid({
dataSource: {
transport: {
read: {
url: "http://localhost/CoreProcess/proceso/getusers",
dataType: "json",
cache: false
},
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"}],
});
Now in the same page i have a little form that inserts new data to the database through an ajax call to a php method (im working with yii framework)
$.ajax({
type: "POST",
url: "http://localhost/CoreProcess/proceso/agregarparticipantes/uuid/" + uuid,
data:
{
post_participante: participante,
post_apellidos: apellidos,
post_email: email,
},
success: function(result)
{
$('#grid').data('kendoGrid').dataSource.read();
}
});
The creation of a new record in the database also works fine but the problem is that after that i want to reload the grid with the new information, perhaps reading again the json url that i should have changed. I have tried a lot of things like
$('#grid').data('kendoGrid').dataSource.read();
$('#grid').data('kendoGrid').dataSource.refresh();
But nothing, i am noob with kendo...anyone could help me? thanks all
$('#grid').kendoGrid({
dataSource: {
transport: {
read: {
url: "http://localhost/CoreProcess/proceso/getusers",
dataType: "json",
cache: false
},
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"}],
});
Now in the same page i have a little form that inserts new data to the database through an ajax call to a php method (im working with yii framework)
$.ajax({
type: "POST",
url: "http://localhost/CoreProcess/proceso/agregarparticipantes/uuid/" + uuid,
data:
{
post_participante: participante,
post_apellidos: apellidos,
post_email: email,
},
success: function(result)
{
$('#grid').data('kendoGrid').dataSource.read();
}
});
The creation of a new record in the database also works fine but the problem is that after that i want to reload the grid with the new information, perhaps reading again the json url that i should have changed. I have tried a lot of things like
$('#grid').data('kendoGrid').dataSource.read();
$('#grid').data('kendoGrid').dataSource.refresh();
But nothing, i am noob with kendo...anyone could help me? thanks all