GridView filter form

There is a general problem with GridView filters.

It’s not uncommon to use GridView inside a form. Good example is a tabbed page, where first tab implement form with main model attributes and next tabs are for related models - and all tabs are within a form, so submit action sends all parameters at once.

GridView is used for information purpose, the end user can evaluate some data in a convenient way while filling forms.

But the problem is with GridView filters!

yii.gridView.js is as follows:

var $form = $('<form/>', {
      action: url,
      method: 'get',
      'class': 'gridview-filter-form',
      style: 'display:none',
     'data-pjax': ''

The filter form element created dynamically is attached to grid element itself what results in nested form!

Why not .appendTo('body'); ???

That would result in leaner structure and nested forms would never be created!

I guess that’s because there could be multiple forms at the same page.

is there any workaround or solution for that. In my case, I have the tabbed structure and now problem to use the filters as described by Ziggi

Name these forms explicitly.

Thanks, but how should this work? There is no implementation in the parameter :-/