mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Fixed column translation problem
This commit is contained in:
@@ -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",
|
||||
|
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user