This question is locked. New answers and comments are not allowed.
Hello,
I am quite new at all this. I'm trying to keep track of currently logged in user throughout the session. I cannot use Everlive services, and my users is read from database. I also have some more session parameters, which I dont know how to store. I am actually storing userdata(username and password) in a kendo.observable object, but the problem is that my dataSource object is probably initialized before userdata is set:
i have something like this:
on login:
usersModel.currentUser.set('username', username);
usersModel.currentUser.set('password', password);
after login this data from this data source is retrieved.
var eventsDataSource = new kendo.data.DataSource({
schema: {
model: eventModel
},
transport: {
read: {
url: WCF + "/GetOrganizerEventsJSON",
data: { strUser: usersModel.currentUser.username, strPasswort: usersModel.currentUser.password },
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
crossDomain: true
}
}
});
return {
events: eventsDataSource
};
Problem is that username and password are "" (empty strings) in the request. I also tried with defining data as a function, but no success, still empty strings.
data: { strUser: usersModel.getCurrentUser().username, strPasswort: usersModel.getCurrentUser().password }
I am quite new at all this. I'm trying to keep track of currently logged in user throughout the session. I cannot use Everlive services, and my users is read from database. I also have some more session parameters, which I dont know how to store. I am actually storing userdata(username and password) in a kendo.observable object, but the problem is that my dataSource object is probably initialized before userdata is set:
i have something like this:
on login:
usersModel.currentUser.set('username', username);
usersModel.currentUser.set('password', password);
after login this data from this data source is retrieved.
var eventsDataSource = new kendo.data.DataSource({
schema: {
model: eventModel
},
transport: {
read: {
url: WCF + "/GetOrganizerEventsJSON",
data: { strUser: usersModel.currentUser.username, strPasswort: usersModel.currentUser.password },
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
crossDomain: true
}
}
});
return {
events: eventsDataSource
};
Problem is that username and password are "" (empty strings) in the request. I also tried with defining data as a function, but no success, still empty strings.
data: { strUser: usersModel.getCurrentUser().username, strPasswort: usersModel.getCurrentUser().password }