When something goes wrong with the read: on server it will send an HTML message and not deliver XML. successCheck is never run and developer tools shows me a "Breaking on JScript runtime error -- invalid XML: ...the server response..."
Where should I put a try/catch ? Or How should I otherwise make sure the server response is actually XML before handing it off to the xml parser?
Thanks,
Richard
Where should I put a try/catch ? Or How should I otherwise make sure the server response is actually XML before handing it off to the xml parser?
var
crud =
"/MyCollections"
;
var
successCheck =
function
(data) { alert(data); }
var
dataSource1 =
new
kendo.data.DataSource ({
transport: {
read:
{ cache:
false
, url: crud, data: { action:
'list'
}, success: successCheck },
update:
{ cache:
false
, url: crud, data: { action:
'update'
}, success: successCheck },
destroy:
{ cache:
false
, url: crud, data: { action:
'delete'
}, success: successCheck },
create:
{ cache:
false
, url: crud, data: { action:
'create'
}, success: successCheck }
},
schema: {
type:
'xml'
,
data:
'/TABLE/TREEVIEWS'
,
model: {
fields: {
treeview:
"treeview/text()"
,
name:
"name/text()"
,
timestamp:
"timestamp/text()"
}
}
}
});
Thanks,
Richard