I want to read from an array and perform CRUD operations on this array but am struggling to find examples of this as all the transport:read examples read the data from a URL instead of an array.
The below works but does not need the CRUD operations
The below does not work with and I get "g is undefined" error. Im not sure of the syntax and how to get it to read from the array.
Can anyone advise?
The below works but does not need the CRUD operations
function listTicketsInit() {
var ticketdata = <?=json_encode($tickets)?>;
var ticketDataSource = new kendo.data.DataSource({
data: ticketdata,
dataType: "json",
schema: {
model: {
id: "ThreadID",
fields: {
DateCreated: "DateCreated",
ThreadID: "ThreadID",
Subject: "Subject",
Closed: "Closed"
}
}
}
});
$("#support_list").kendoMobileListView({
dataSource: ticketDataSource,
//pullToRefresh: true,
appendOnRefresh: true,
style: "inset",
template: $("#support_list_template").text()
});
}
The below does not work with and I get "g is undefined" error. Im not sure of the syntax and how to get it to read from the array.
var messagedata = <?=json_encode($messages)?>;
var messageDataSource = new kendo.data.DataSource({
data: messagedata,
transport: {
update: {
url: "/messages/markasread/<?=$message->message->id?>/0",
type: "GET"
},
destroy: {
url: "/messages/delete/<?=$message->message->id?>",
type: "GET"
}
},
schema: {
model: {
id: "id",
fields: {
created: "created",
message: "message",
customer_name: "customer_name",
isnew: "isnew",
}
}
}
});
$("#message_list").kendoMobileListView({
dataSource: messageDataSource,
//pullToRefresh: true,
appendOnRefresh: true,
style: "inset",
template: $("#message_list_template").text()
});
Can anyone advise?