i have a form with a button that upon clicked should fill a grid with data via ajax to a php script. the php script is ok but no data is shown on the grid..here 's my code below...any help please!!!
//function for button clicked
$(function(){
$("#fetchmani").click(function(){
var routes = document.getElementById('routes').value;
$.ajax({
type: 'POST',
url: 'data/fetchmani.php',
data: "routes="+ routes,
success: function(response){
var grid = $("#grid").data("kendoGrid");
grid.dataSource.read();
}
});
});
});
</script>
<button id="fetchmani" class="k-button" style="margin-left:15px;width:100px">Fetch Manifest</button>
// grid code
var routeid = 0;
$(document).ready(function () {
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "data/fetchmani.php",
dataType: "json",
type:"POST"
},
parameterMap: function(options, operation) {
return {
id: routeid
}
}
},
batch: true,
pageSize: 20,
serverPaging: true,
serverSorting: true,
serverFiltering: true,
schema: {
data:"data",
total:"total"
}
});
//function for button clicked
$(function(){
$("#fetchmani").click(function(){
var routes = document.getElementById('routes').value;
$.ajax({
type: 'POST',
url: 'data/fetchmani.php',
data: "routes="+ routes,
success: function(response){
var grid = $("#grid").data("kendoGrid");
grid.dataSource.read();
}
});
});
});
</script>
<button id="fetchmani" class="k-button" style="margin-left:15px;width:100px">Fetch Manifest</button>
// grid code
var routeid = 0;
$(document).ready(function () {
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "data/fetchmani.php",
dataType: "json",
type:"POST"
},
parameterMap: function(options, operation) {
return {
id: routeid
}
}
},
batch: true,
pageSize: 20,
serverPaging: true,
serverSorting: true,
serverFiltering: true,
schema: {
data:"data",
total:"total"
}
});