[ADF-551] allow setting sorting in html (#1857)

* allow setting sorting in html

* readme update

* update readme

* restore permissions code

* - Remove the check permission from the datatable and move inside the documentlist

* Remove commented test
This commit is contained in:
Denys Vuika
2017-05-10 15:43:38 +01:00
committed by Eugenio Romano
parent 416d8c2a1b
commit b0be88ec37
7 changed files with 216 additions and 120 deletions

View File

@@ -235,33 +235,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges {
getRowActions(row: DataRow, col: DataColumn): any[] {
let event = new DataCellEvent(row, col, []);
this.showRowActionsMenu.emit(event);
return this.checkPermissions(row, event.value.actions);
}
checkPermissions(row: DataRow, actions: any[]) {
let actionsPermission = [];
actions.forEach((action) => {
actionsPermission.push(this.checkPermission(row, action));
});
return actionsPermission;
}
checkPermission(row: DataRow, action) {
if (action.permission) {
if (this.hasPermissions(row)) {
let permissions = row.getValue('allowableOperations');
let findPermission = permissions.find(permission => permission === action.permission);
if (!findPermission && action.disableWithNoPermission === true) {
action.disabled = true;
}
}
}
return action;
}
private hasPermissions(row: DataRow): boolean {
return row.getValue('allowableOperations') ? true : false;
return event.value.actions;
}
onExecuteRowAction(row: DataRow, action: any) {