Hi
I would like to send a value (userid) with the read command of dataSource. I've done several tests but I can't catch the posted value in PHP.
Working ( $userid = $_POST["userid"] = 1234 on server side):
$.ajax({
type: 'POST',
url: 'readparameter.php',
data: {userid: "1234"},
async: true,
dataType: 'json',
success: function(result) {
console.log (result);
}
});
Not working ( $userid = $_POST["userid"] = NULL on server side):
var mySource = new kendo.data.DataSource({
dataType: 'json',
transport: {
read: function (options) {
$.ajax({
type: "POST",
dataType: 'json',
async: true,
data: {userid: "1234"},
url: "readparameter.php",
success: function (result) {
console.log (result);
}
});
}
}
});
My assumption is that the posted userid never reaches the server using dataSource. I'm trying since a lot of time and tried several ways like also Json.stringify etc. What am I doing wrong or is it just not possible to pass a value with dataSource?