Morning! we have a cloud data table called InAppMessages. i'm trying to submit some custom parameters from my client app when it reads its datasource attached to the everlive table so i can do some cloud data magic in the 'after read' functions using those parameters.
i haven't found any way to insert the custom parameters successfully into the header of my datasource. i've tried making a transport: read function that uses ajax call per some other postings but i get a access key not valid error. i tried modifying the header of the datasource using a custom transport read but just fails to run (errors in the app telling me the datasource doesn't exist). i could post a bunch of code samples but i tried some significantly different approaches. i figure this must be a well understood process but the documentation on the site did not work for me nor did any in postings. i wanted to start this thread to get some recommended processes.
here's the first way i tried and what i thought should work:
custParams = {
"Age":36,
"MemLevel":"Family"
var messageCenterDatasource = new kendo.data.DataSource({
type: 'everlive',
transport: {
read: {
beforeSend: function (xhr) {
xhr.setRequestHeader("X-Everlive-Custom-Parameters", JSON.stringify(custParams));
},
},
schema: {
model: { id: Everlive.idField},
},
serverSorting: true,
sort: {field: 'CreatedAt', dir: 'asc' },
change: function(e) {
//do stuff
}
});