Defines the Row Filter function used by the Document List Component.
type RowFilter = (value: ShareDataRow, index: number, array: ShareDataRow[]) => anyShareDataRow - Data that defines the rownumber - Index of the row within the listShareDataRow[] - The full set of rows for the listA row filter function selectively hides or shows rows from a Document List Component or another component that uses the Document List (such as the Content Node Selector Panel Component). You can supply your own row filter to customize the behavior of the list.
The function returns true if the row should be
displayed or false if it should be hidden.
A typical row filter implementation receives at least a ShareDataRow object as a parameter:
myFilter(row: ShareDataRow): boolean { return true; }
Note that for the sake of simplicity the example code below was reduced to the main points of interest only.
View1.component.html
<adf-document-list
[rowFilter]="folderFilter">
</adf-document-list>
View1.component.ts
import { RowFilter, ShareDataRow } from '@alfresco/adf-content-services';
class View1 {
folderFilter: RowFilter;
constructor() {
// This filter will make the document list show only folders
this.folderFilter = (row: ShareDataRow) => {
let node = row.node.entry;
if (node && node.isFolder) {
return true;
}
return false;
};
}
}
© 2023 Alfresco Software, Inc. All Rights Reserved.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.