How to customize <nuxeo-data-grid> results?

We have a specific workspace doctype created with a custom page provider to show relevant columns for the doctype's fields. I was able to customize the layout view for the nuxeo-data-table, but am having a hard time finding information on how to customize the nuxeo-data-grid & nuxeo-document-grid-thumbnail

The default layout for nuxeo-document-grid-thumbnail shows the dc:title and the ecm:primaryType below that. However, since all the doctypes are the same in this workspace we want to change the ecm:primaryType to something more relevant. We also want to modify the drop-down for sorting so it isn't the standard “Title, Created, Modified, Last contributor, State, Nature, Coverage” selections. I would have thought that the grid would be similar to changing as the table, but that doesn't see to be the case.

Here is the code on GitHub that I've found: https://github.com/nuxeo/nuxeo-web-ui/blob/97f30604becd599b1c0d3d5ad1ce8b7c7a87bf40/elements/nuxeo-data-grid/nuxeo-document-grid-thumbnail.js

Do I need to copy that and make a custom element not named “nuxeo-document-grid-thumbnail” and reference that instead? Seems like this would be a common customization, so guidance would be appreciated. Thanks.

0 votes

1 answers

158 views

ANSWER



Hi Phil,

The easiest would be to copy the default nuxeo-document-grid-thumbnail element (be careful about the branch you're checking: use 10.10 branch), then add the customization you need inside the custom element, and substitute the default element with yours in the nuxeo results (generated by Studio).

That said, it would be nice to get a visual way to do it in Nuxeo Studio Designer. Feel free to share your feedback: https://portal.prodpad.com/25470

Best regards

0 votes



Thanks for the feedback. That is what I thought, although I hoped for something easier. I'll submit a feature request from the link you gave.
01/21/2021

I opened up a feature request ticket with support. It should be passed on to the Studio team for review, so maybe this will change in the future.
02/04/2021