Modify Quick/Advanced filter view when filtering in list view?

Hi,
I want to add some modifications to the quick/advanced filter which pops up when you click on filter in the list view.
I want to print some additional instructions into the view with some java script and remove some drop-down options which should not show up.

I was naively trying to add an ‘includes’ entry to custom/modules//metadata/searchdefs.php which points to a JS file, which would apply the modifications. Essentially the same way you can do it with editview.defs.
The includes entry does not seem to work there? Is the searchdefs.php somehow different form the other views?

i.e. I try to add my JS like this to the searchdefs:


 'templateMeta' => 
  array (
    'maxColumns' => '3',
    'maxColumnsBasic' => '4',
    'widths' => 
    array (
      'label' => '10',
      'field' => '30',
    ),
    'includes' => 
    array (
      0 => 
      array (
        'file' => 'custom/modules/<module>/my_custom_code.js',
      ),
    ),
  ),

I don’t think searchdefs are loaded like other views, no.

Try to find the .tpl from which it is built, and add it there. You shouldn’t need Javascript, it can be done in the back-end.

I would want that this change I have in mind is only affecting one module. Furthermore, I want conditional filter options, i.e. if filter-A is set to X show in filter-B only options Y1, Y2 (but no Z). This rather easy with java-script but would require that I some find the place to inject Javascript.

Editing the .tpl would introduce changes for all modules?

It depends on whether this tpl is generic for all modules, or if it is overriden by this particular module, you will have to check.

The tpl can have conditions based on module (written in Smarty code).

The tpl generates HTML so I expect you can inject the JS at the top.