filtering with rowspan

Hello,



I’d like to use a Grid with 9 columns.

The 4 first cells of each row can have a rowspan=2 or rowspan=3

Here is an example of my xml for a rowspan=2

    

Field 1     

Field 2     

Field 3     

Field 4

Field 5     

Field 6     

Field 7    

Field 8     

Field 9     





    

    

    



Field 5     

Field 6     

Field 7    

Field 8     

Field 9     





The display of the table is ok but I also want to use filtering on every column and I have 2 problems:

- when I filter on one of the 4 first columns, I only get the first row of the rowspan, I would like to get all rows

- when I filter on one of the 5 last columns on a value not in the first row of a rowspan, the grid displays only the 5 last columns without the 4 first.



Is there a way to get the expected behavior? (I define my filters with the function attachHeader())



Thanks!

The rowspan can cause problem for filtering routine if filtering will result in hiding only part of row-spanned rows
Unfortunately there is no easy way to change existing behavior. If list of values is predefined, you can redefine collectValues method of grid, to provide custom list of options instead of auto-generated one.


I don’t want to hide part of row-spanned rows.



Let’s say I have this



    | B | C







   | D | E



 



So if I filter on the first column with the value A, I would want to get



    | B | C







   | D | E



 



but instead I have



 A  | B | C



 

Unfortunately there is no easy way to change existing behavior. If list of values is predefined, you can catch “onFilterStart” event and return grid in the necessary order.


I don’t really see how I could use the “onFilterStart” event to get the expected behavior.



Could you give some more details please?



Thank you!



 

“onFilterStart” could be used to block default grid filtering and return rows in the necessary order:
mygrid.attachEvent(“onFilterStart”,function(indexes,values){
mygrid.clearAll();
mygrid.load(“grid_with_necessary_rows_order.xml”);
return false;
});