I have a grid with a list of reports. The user must accpet/reject a report by clicking the command buttons. After that, the moderator.person_aname must be updated in the grid show who accepted/rejected it. Everything works fine, except the moderator.person_aname does not change. Even the confirm/reject buttons hide correctly. Please help!
$scope.confirm =
function
(report) {
$wamp.call(
'confirm_report'
, [report.id]).then(
//callback
function
(new_report) {
$log.log(new_report);
report.is_confirmed = new_report.is_confirmed;
report.is_rejected = new_report.is_rejected;
report.moderator.person_aname = new_report.moderator.person_aname;
var
grid = $(
"#recentReportsGrid"
).data(
"kendoGrid"
);
var
select = grid.dataSource.get(report.id);
select.moderator.person_aname = new_report.moderator.person_aname;
},
//error callback
function
(err) {
$log.log(
"user.get_status error:"
, err);
}
);
};
Grid columns
{
template:
"<span ng-if='#: is_confirmed #'>Confirmed</span><span ng-if='#: is_rejected #'>Rejected</span><span ng-if='#: !(is_confirmed||is_rejected) #'>Pending</span>"
,
field:
"is_confirmed"
,
title:
"Decision"
,
width: 60
},{
field:
"moderator.person_aname"
,
title:
"Moderator"
,
width: 50
},{
command: [{
template:
'<a class=\'k-button\' ng-show=\'dataItem.demo_info.demo_on_web_server\' target=\'_blank\' ng-href=\'{{dataItem.demo_info.url}}\'><i class="icon-edit"></i>'
+
'<span>Download Demo</span>'
+
'</a>'
+
'<button ng-hide=\'dataItem.is_confirmed||dataItem.is_rejected\' class=\'k-button\' ng-click=\'confirm(dataItem)\'><i class="icon-edit"></i>Confirm</button>'
+
'<button ng-hide=\'dataItem.is_confirmed||dataItem.is_rejected\' class=\'k-button\' ng-click=\'reject(dataItem)\'><i class="icon-edit"></i>Reject</button>'
}
],
title:
"Actions"
,
width: 210
}