How to show a datagrid with different xpath constraints with one button?

Hi   at the moment we have a datagrid with some xpath showing the current orders. we want to make possible to show also the past orders by clicking on a button (maf a mf or so which enforces the datagrid to load with a different xpath?) to include pastorders [pastorder= true()] also in the xpath constraints, so it will be immediately visible. I think to work around with visibilities but that is not nice and a lot of management of the attributes. Who has a better idea?
2 answers

Hi Enzo,

I built a widget that allows you to add predefined xpath filters to data grids and listviews, extending the default search functionality.

you can grab the MPK from the /dist folder on the Github repository. It adds the filter buttons in the search area, so make sure you're showing the search fields on your data grid :)

I hope this helps!




I assume you have an xpath currently that has something like [pastorder=false()] or [not(pastorder)] in it?  If so, remove this part of the xpath which should give you a datagrid showing all orders, current and past.

To achieve what you want, add a search attribute for pastorder in the search area of your datagrid, and set the default value to false.  The datagrid will then display all current orders by default, but you are able to show past orders or all orders by changing this search attribute in your datagrid.