hide field from a seach box in a grid

Hi to everybody,
I need to hide a field from a seach box in a grid. I tried to use the macro sc_field_display in onScriptInit and onRefresh events but it doesn’t work.
The example of the script is:

if ($test==‘hello’){
sc_field_display({field1}, off);
}

It work in the grid events but it doesn’t work in the seach box of the grid. Why?
Thank you all.

Michele

Hi, use the event Ajax OnChance ‘your field’ and tests.