I am using Data Grid instead of List because it automatically implements a lot of functions of a visual data table: Sort By Column, Different Row Colors, Column Width and so on. The only disadvantage of the Data Grid, it needs a different Search Text Box for every Attribute of the data entity which is listed in the data grid. I need a search text box, which is searching for every attribute at the same time. This is possible in the case of a List, but not in the case of a Data Grid, expect by using a widget from the app store, which is called Grid Search. The example App of Grid Search shows exactly what I would like to implement for my Data Grid. The only problem is, I do not know if it is possible to add it to my app in the online Studio. In the description, it says I have to download the widget and add it to my app via the PC Software, Studio Pro. If I do that, then appears a widget called ‘AnySearch’. If I add it to the same page where the data grid is, there comes an error message that I should move it into a data container. But even if I try, I cannot drag and drop it into the data grid area. Another solution what I tried, is to commit and push the app into the online editor while having the ‘AnySearch’ in it (which supposedly comes from the Grid Search widget). After that, the ‘AnySearch’ text field also appears in the only Studio. But if I add it to my App and I choose a Filter Label Value (see picture) I get the following error: The selected page expects an object of type [Entity], which is not available here. Does anybody know how to implement it? Is not there a way to open this example App of Grid Search in Studio Pro or in the online Studio, so I am able to edit it and I see how it is implemented?
The AnySearch widget you are trying to use requires a context entity. The message about placing in a data container means that it should be inside a data view or a list view, but not the data grid. In you scenario, you will require a SearchHelper entity and then a data view for this entity. Your data grid will be enclosed in this data view of SearchHelper. SearchHelper will have an attribute that contains the xpath string for the criteria you want to filter data grid on. Below is a part of description of this widget that also explains the same.
Any Search: takes an xpath string from the context entity and applies it to the list/grid! Develop any kind of inputs you like, and use a microflow or nanoflow to create the XPath string that should be applied to the grid!
If you want to search on multiple fields at same, then you can use the multifiled widget. It will work without data container. Place it above the data grid and see docs for configuring it.
For the test project, visit this link, download test.mpr file. Open it in required mendix version (install mendix I guess 7.23.1 first). Then resolve any errors in the project by downloading required app store widgets. Just make the project working step by step.