Hello
In the past I was using the fetch operation like this:
var
gameObject =
new
kendo.data.DataSource({
transport: {
read: {
url:
"../php/readgamelist.php"
,
type:
"POST"
,
dataType:
"json"
,
contentType:
"application/json; charset=utf-8"
}
}
,success {}
,error {}
});
gameObject.fetch (...)
I've found out that with the success/error won't work anymore (maybe I'm wrong on success/error anyway and it never really worked properly). Of course in between I have installed newer KendoUI versions. Nevertheless I had to rewrite my code to make it working again:
console.log (
'1'
);
var
gameObject =
new
kendo.data.DataSource({
transport: {
read: {
url:
"../php/readgamelist.php"
,
type:
"POST"
,
dataType:
"json"
,
contentType:
"application/json; charset=utf-8"
}
}
});
console.log (
'2'
);
gameObject.fetch()
.then(
function
(){
console.log (
'3'
);
console.log (gameObject.data());
})
.
catch
(
function
(error) {
console.log (
'4'
);
console.log (error);
});
This now works so far as it should. The problem comes up when I will not use the page (with this code) for hours. So there is a kind of server timeout. Calling then this function by page (GUI) will lead into this Browser output:
1
2
TypeError: e.slice is not a function. (In 'e.slice(0)', 'e.slice' is undefined) success kendo.all.js 7001
I have no clue why this error is coming up and how to fix that. My server (on which readgamelist.php is stored) can even handle a timeout and would return information about that (by return it to gameObject.data() but it doesn't seem to come to this since "3" is not in the error output. So therefore it won't come to read from the php file.
There is no example to catch an error in your fetch examples but I think I did it the correct way. I'm also confused that kendo.all.js returns from "success". I don't know the current version of Kendo UI I'm using (can't find any version hint in the files but it must be one of the latest one).
What else can I do to catch the real error?
Regards