adf document-list filter won't show up

cancel
Showing results for 
Search instead for 
Did you mean: 
rinakakis
Member II

adf document-list filter won't show up

Hello everybody, im trying to use the headerfilter for the adf-document-list and the filters won't show up.  

This is how i use it 

<adf-document-list
  #documentList
  [navigationMode]="'click'"
  [headerFilters]="true" <-----
  [currentFolderId]="currentFolderId"
  [display] = "'list'"
  [allowDropFiles]="true"
  [sorting]="['name''asc']"
  [contextMenuActions]="true"
  [contentActions]="true"
  (preview)="showPreview($event)"
  >

 

Any ideas?

Thanks,
George

1 Reply
janm
Member II

Re: adf document-list filter won't show up

Hi George, 

  I was solving the same issue. In an alfresco example project  alfresco-ng2-components https://github.com/Alfresco/alfresco-ng2-components  I noticed in the app.config.json the "search-headers" attribute, where you have to define the Header Filter attributes:  app:fields, categories... But the problem is, that I cannot find any documentation for the app.config.json, e.g. how to configure the "search-headers". Anyway this helped me, finaly I have header filer for the 'createdAt' column

Please find the example: 

 
"search-headers": {
"filterWithContains": true,
"app:fields": [
"cm:name",
"cm:title",
"cm:description",
"ia:whatEvent",
"ia:descriptionEvent",
"lnk:title",
"lnk:description",
"TEXT",
"TAG"
],
"categories": [
{
"id": "queryName",
"name": "SEARCH.SEARCH_HEADER.FILTERS.NAME.TITLE",
"columnKey": "name",
"enabled": true,
"component": {
"selector": "text",
"settings": {
"pattern": "cm:name:'(.*?)'",
"field": "cm:name",
"placeholder": "SEARCH.SEARCH_HEADER.FILTERS.NAME.PLACEHOLDER",
"searchSuffix": "*",
"allowUpdateOnChange": false
}
}
},
{
"id": "checkList",
"name": "SEARCH.SEARCH_HEADER.FILTERS.TYPE.TITLE",
"columnKey": "$thumbnail",
"enabled": true,
"component": {
"selector": "check-list",
"settings": {
"pageSize": 5,
"allowUpdateOnChange": false,
"operator": "OR",
"options": [
{
"name": "SEARCH.SEARCH_HEADER.FILTERS.TYPE.FOLDER",
"value": "TYPE:'cm:folder'"
},
{
"name": "SEARCH.SEARCH_HEADER.FILTERS.TYPE.DOCUMENT",
"value": "TYPE:'cm:content'"
}
]
}
}
},
{
"id": "contentSize",
"name": "SEARCH.SEARCH_HEADER.FILTERS.SIZE.TITLE",
"columnKey": "content.sizeInBytes",
"enabled": true,
"component": {
"selector": "check-list",
"settings": {
"allowUpdateOnChange": false,
"options": [
{
"name": "SEARCH.SEARCH_HEADER.FILTERS.SIZE.SMALL",
"value": "content.size:[0 TO 1048576] OR TYPE:'cm:folder'"
},
{
"name": "SEARCH.SEARCH_HEADER.FILTERS.SIZE.MEDIUM",
"value": "content.size:[1048576 TO 52428800] OR TYPE:'cm:folder'"
},
{
"name": "SEARCH.SEARCH_HEADER.FILTERS.SIZE.LARGE",
"value": "content.size:<52428800 TO 524288000] OR TYPE:'cm:folder'"
},
{
"name": "SEARCH.SEARCH_HEADER.FILTERS.SIZE.HUGE",
"value": "content.size:<524288000 TO MAX] OR TYPE:'cm:folder'"
}
]
}
}
},
{
"id": "createdDateRange",
"name": "SEARCH.SEARCH_HEADER.FILTERS.DATE.TITLE",
"columnKey": "createdAt",
"enabled": true,
"component": {
"selector": "date-range",
"settings": {
"allowUpdateOnChange": false,
"field": "cm:created",
"dateFormat": "DD-MMM-YY",
"maxDate": "today"
}
}
}
],
"highlight": {
"prefix": " ",
"postfix": " ",
"mergeContiguous": true,
"fields": [
{
"field": "cm:title"
},
{
"field": "description",
"prefix": "(",
"postfix": ")"
}
]
},
"sorting": {
"options": [
{
"key": "name",
"label": "Name",
"type": "FIELD",
"field": "cm:name",
"ascending": true
},
{
"key": "content.sizeInBytes",
"label": "Size",
"type": "FIELD",
"field": "content.size",
"ascending": true
},
{
"key": "createdByUser.displayName",
"label": "Author",
"type": "FIELD",
"field": "cm:creator",
"ascending": true
},
{
"key": "createdAt",
"label": "Created",
"type": "FIELD",
"field": "cm:created",
"ascending": true
},
{
"key": "score",
"label": "Relevance",
"type": "FIELD",
"field": "score",
"ascending": false
}
],
"defaults": [
{
"key": "score",
"type": "FIELD",
"field": "score",
"ascending": false
}
]
}
},
 
I believe this will help you, if you find the mentioned documentation please let me know
thank you
jan