Fixed column translation problem

This commit is contained in:
mauriziovitale84
2016-05-23 15:33:04 +01:00
parent a4a26d48be
commit 9331e07c6e
3 changed files with 24 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "ng2-alfresco-documentlist",
"description": "Alfresco Angular2 Document List Component",
"version": "0.1.4",
"version": "0.1.5",
"author": "Alfresco Software, Ltd.",
"scripts": {
"typings": "typings install",

View File

@@ -38,4 +38,18 @@ export class ContentColumnList {
this.documentList.columns.push(column);
}
}
/**
* Update the title with the new value
* @param column Column definition model.
*/
updateColumn(column: ContentColumnModel): void {
if (this.documentList && column) {
this.documentList.columns.forEach((tmpColumn) => {
if (tmpColumn.source === column.source) {
tmpColumn.title = column.title;
}
});
}
}
}

View File

@@ -58,4 +58,13 @@ export class ContentColumn implements OnInit {
this.list.registerColumn(model);
}
}
ngOnChanges(change) {
let model = new ContentColumnModel();
model.title = this.title;
model.source = this.source;
if (this.list) {
this.list.updateColumn(model);
}
}
}