How can I use wildcard filters for dropdowns in grid and for predefined Default Searches?

Hi community,

the ItemType definition allows us to specify "Default Searches" for certain properties. I want to specify a "Default Search" that excludes a certain dropdown value when user search in a grid. Something like this works fine for regular properties, but not for dropdowns.

In general, dropdowns right not don´t support that user search with wildcards or use other custom search modes (like exclude). Users only can search with distinct values from the dropdown.

I assume this has to do with the type-ahead behavior of dropdowns. But this is a bit strange, cause similar properties like item and classification selectors allow us to use wildcards and type-ahead.

Does anyone know what I need to change to make wildcard searches work for dropdowns?

I checked the Search Mode. The purpose of any Search Mode is to build the AML query for the server to get the data. We probably need to modify it, but right now it doesn´t even receive the search filter. My wildcarded dropdown search value is simply ignored and not included in the AML query.

It seems to be filtered long before the Search Mode itself kicks in. I assume the wildcarded search string makes the input invalid, so the search filter is excluded from the AML query used for the server.

Does anyone know, which codetree files are used to validate the search strings in the blue search row? I made some tests, but so far I haven´t found the right file.

Thanks for any hint!

Angela

  • I think it will be very difficult to do. The search string constructs its controls by requesting the corresponding ItemType property type. So if property data type is list it constructs the dropdown. You can try to change at runtime search type for this column to text or multi value list, but where should you put your code? You don't have a OnLoad event for search grid.

    I can only think of one option - custom search mode.But I don’t know how to bind this mode to only one or some ItemType. And how does this search mode know which list properties to change search type and which ones not to.

    If you decide to go this route, this line change the type of the search control to multi value list (or you can change it to "text").

    grid._grid._head.set('propertyName_D', 'multiValueList', 'searchType')

    where "grid" is the reference to grid container, propertyName is the name of your property ("_D" at the end is mandatory). This must be called after the grid is created but before search mode initialization. So the only place where you can put it is the SearchMode.OnStartSearchMode.

    Or you can change the data type of your property to multi value list and validate the user input to select only one value on the form. I think it's much easier.

  • Hi Alaxala,

    thanks for ideas and recommendations! I will test a few things a let you know when I make some progress!