added create and create+edit context menus with options.
created stub methods for performing the edit/create actions. #29
This commit is contained in:
parent
0bbbd76253
commit
86e0b60386
@ -12,6 +12,7 @@
|
||||
self.chosenTimeLogUserId = -1;
|
||||
self.selectedCalendarWeek = ko.observable(0);
|
||||
self.errorData = ko.observable(null);
|
||||
self.manualLog = ko.observable(null);
|
||||
self.apiEndpoints = {
|
||||
root: "http://localhost:8800",
|
||||
getUserList: "/api/users",
|
||||
@ -382,6 +383,32 @@
|
||||
self.assignErrorObject(errObj.errorCode, errObj.errorMessage, "getGroups");
|
||||
});
|
||||
};
|
||||
self.createContextMenu = ko.observableArray([
|
||||
{ text: "Create", action: createlog }
|
||||
]);
|
||||
self.editContextMenu = ko.observableArray([
|
||||
{ text: "text", action: clicked },
|
||||
{ text: "Edit", action: editlog },
|
||||
{ text: "Create", action: createlog }
|
||||
]);
|
||||
function editlog (data) {
|
||||
alert("edit");
|
||||
}
|
||||
function createlog(data) {
|
||||
self.manualLog({
|
||||
CalendarWeek:-1,
|
||||
Direction:-1,
|
||||
EventTime: "2017-03-01T07:44:41.0861152+00:00",
|
||||
Id: -1,
|
||||
IdentifierId: -1,
|
||||
UserId: self.chosenTimeLogUserId(),
|
||||
Year: 0
|
||||
});
|
||||
$('#manualLogDialog').modal("show");
|
||||
}
|
||||
function clicked(data) {
|
||||
alert('oh, you clicked me! ah, and you typed "' + data.value() + '"');
|
||||
}
|
||||
Sammy(function () {
|
||||
this.get("#users", function () {
|
||||
var query = this.params.query;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user