projecten

This commit is contained in:
2018-01-18 08:45:09 +01:00
parent 00246f49f7
commit 970aa53971
25 changed files with 689 additions and 285 deletions
+47
View File
@@ -0,0 +1,47 @@
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 17/01/2018
* Time: 09:55
*/
dbo.commentsService = {
tableName: 'OFFER',
addComment: function () {
var vm = dbo.offersModel;
dbo.commentsDataService.addComment( vm.selectedRowID(), vm.tableName, function ( commentID ) {
dbo.commentModel.showComment( commentID, function () {
vm.refreshComments();
} )
} );
},
editComment: function () {
var vm = dbo.offersModel;
dbo.commentModel.showComment( this.id, function () {
vm.refreshComments();
} );
},
refreshComments: function () {
var vm = dbo.offersModel;
dbo.commentsDataService.getComments( vm.selectedRowID(), vm.tableName, function ( data ) {
vm.comments.removeAll();
console.log( data );
$.each( data, function ( i, p ) {
vm.comments.push( new vm.Comment( p ) );
} );
} );
},
Comment: function ( data ) {
this.id = data.id;
this.comment_date = data.comment_date;
this.fullname = data.user.fullname;
this.comment = ko.observable( data.comment );
},
}