Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How should I use a listGrid with a collection of my favorites records from a specific document?

I need to show a collection using listgrid and plan to have the filtering mechanism on that? how to do this?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

There is no filtering in a data grid, so you are right, you’ll need a list grid.

ListGrids are powered by org.skyve.metadata.view.model.list.ListModel s.
There are some implementations built-in such as org.skyve.metadata.view.model.list.DocumentQueryListModel that can generate the data required by building a DocumentQuery from a metadata query.

There is a org.skyve.metadata.view.model.list.ReferenceListModel that you can extend to give the driving document and reference binding.
The referenceBinding is the binding to your collection (or association) with respect to the document backing the view that the list grid is contained in.

Take a look at modules.admin.UserDashboard.models.FavouritesModel.
You can see that the admin.UserDashboard.favourites collection is a collection of Generic and and the FavouritesModel has a driving document of "Generic" and a referenceBinding of "favourites".

Also, the model’s column definitions use binding expressions relating to the driving document of the model, in this case admin.Generic.
This is congruent with meta data query columns.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading