adf-document-list dynamic columns

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

adf-document-list dynamic columns

Hello,

I need to build a document-list with custom columns from a selected custom type.

workflow: select the custom type, search documents by property, list documents.

until the search documents i'm almost ok, I can present de result in document list but i would the custom columns

I see that for custom columns i need to write the html file but it's too static. I need to define the columns on runtime. I see the ADF Component Catalog DataTable component, but i don't understand how to define the columns in the document list component ADF Component Catalog  .

3 Replies
dvuika
Alfresco Employee

Re: adf-document-list dynamic columns

Document List is based on Data Table component, so all documentation for Data Table applies. You can check docs on Data Adapters that allow to set both data and schema (columns) at runtime.

shivanir
Member II

Re: adf-document-list dynamic columns

You can check the Data Table component from the component catalog DataTable component. In the given screenshot, the schema can be defined at runtime. So, on HTML page you need not require to specify the columns.

dylanvdbrink
Member II

Re: adf-document-list dynamic columns

I've done it like this:

 

<adf-document-list
    [includeFields]="['properties']">
    <data-columns>
        <data-column key="$thumbnail" type="image"></data-column>
        <data-column
            title="Name" 
            key="name">
        </data-column>
        <data-column
            title="CP1" 
            key="properties.cp:customProperty1">
        </data-column>
        <data-column
            title="CP2" 
            key="properties.cp:customProperty2">
        </data-column>
    </data-columns>
</adf-document-list>

So set the includeFields property to include the properties and then use this format to specify the key: properties.cp:customProperty2.