or
var
dataSource1 =
new
kendo.data.DataSource ({
transport: {
read:
{ cache:
false
, url: crud, data: { action:
'list'
}, error: 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/THINGS'
,
model: {
id:
"thingid"
,
fields: {
thingid: { editable:
false
, field:
"id/text()"
},
name: { editable:
true
, field:
"name/text()"
},
timestamp: { editable:
false
, field:
"timestamp/text()"
}
}
}
}
}
$(
"#thingList"
).kendoGrid({
dataSource: dataSource1,
pageable:
true
,
toolbar: [
{ name:
"create"
, text:
"New Thing"
, id:
"add"
}],
columns: [
{ field:
"name"
, title:
"Name"
, template:
"<a class='viewlink' href='viewthing?id=${thingid}'>${name}</a>"
},
{ field:
"timestamp"
, title:
"Created"
, width:
"12em"
},
{ command: [ {name:
"edit"
,text:
"Rename"
},
"destroy"
], title:
" "
, width:
"15.5em"
} ],
editable:
"inline"
});