Template grid visibility

0
Am having a GridSearch widget over a template grid. I want to make the template grid visible only if I enter any characters in GridSearch widget. Am designing a shopping site. So I need a empty search bar to appear initially.  On searching for some specific products i need to list down the matching items like the one below Any suggestions on how to achieve this ?
asked
3 answers
1

If you are using the default template grid, and the data source is from database or XPath, you have the option to 'wait for search' on the data source tab.  You have to set the 'Show Search Bar' to 'Always' for this option to appear, but it sounds like this accomplishes what you want.  This may achieve what you are looking for without using a custom widget

answered
0

Preetha,

I'm not sure exactly what widget you are using, but you can accomplish this if it has "on change" or "on leave" event. You can create a boolean value that will be used to show the visibility of the template grid. Use conditional visibility on the template grid to only show if the boolean value is true. In the widget, use an on change or on leave event, to trigger a microflow that sets the boolean value to "true", which will display the template grid (make sure to use refresh in client for the change activity).

 

 

Another alternative would to try and leverage conditional visibility based on an expression.

answered
0

The CSS you'll need to hide the "always" shown Mendix search bar:

.hide-search {
	.mx-grid-searchbar {
		display:none;
	}
}

Then simply add the class 'hide-search' to your TemplateGrid.

answered