Provide an url to filter by appId

This commit is contained in:
mauriziovitale84
2016-09-08 16:27:30 +01:00
parent de099e505e
commit 638a52dc25
3 changed files with 17 additions and 2 deletions

View File

@@ -19,6 +19,8 @@ import { Component, AfterViewChecked, ViewChild, Input } from '@angular/core';
import { ALFRESCO_TASKLIST_DIRECTIVES } from 'ng2-activiti-tasklist';
import { ACTIVITI_PROCESSLIST_DIRECTIVES } from 'ng2-activiti-processlist';
import { ActivitiForm } from 'ng2-activiti-form';
import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs/Rx';
declare let __moduleName: string;
declare var componentHandler;
@@ -55,6 +57,8 @@ export class ActivitiDemoComponent implements AfterViewChecked {
taskFilter: any;
processFilter: any;
private sub: Subscription;
@Input()
appId: string;
@@ -70,7 +74,7 @@ export class ActivitiDemoComponent implements AfterViewChecked {
return this.currentChoice === 'task-list';
}
constructor() {
constructor(private route: ActivatedRoute) {
this.taskSchemaColumns = [
{type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true}
// {type: 'text', key: 'created', title: 'Created', sortable: true}
@@ -80,6 +84,16 @@ export class ActivitiDemoComponent implements AfterViewChecked {
];
}
ngOnInit() {
this.sub = this.route.params.subscribe(params => {
this.appId = params['appId'];
});
}
ngOnDestroy() {
this.sub.unsubscribe();
}
onTaskFilterClick(event: any) {
this.taskFilter = event;
this.activititasklist.load(this.taskFilter.filter);