ColReorder+ComplexHeaders

ColReorder+ComplexHeaders

jhrabowsjhrabows Posts: 5Questions: 0Answers: 0
edited July 2012 in Bug reports
I am not even sure if this is a valid combination but I have not seen anyone saying that it is invalid. In fact, I have seen claims in other discussions that ComplexHeaders are suppose to work with 'everything'.

The issue can be seen in

http://jsfiddle.net/uXPzN/3/

This is a simple 2-row header where the 1st column spans 2 rows. In addition, there are 2 top-level headers and a larger number of bottom level headers. The reorder seems to try doing something but looks confused. From the visual point of view it seems that re-order is disabled for the top-row headers but in fact the re-order happen at the top-level while you re-order the left-most bottom headers.

That fiddle also has a fixed-column but similar behavior can be seen even without fixed-column plugin.

Replies

  • allanallan Posts: 61,903Questions: 1Answers: 10,148 Site admin
    Hi,

    I'm afraid that at the moment ColReorder does not support "complex headers" :-(. Its really not a trivial problem to solve, how to rearrange the table columns when taking into account rowspan / colspan, and I've yet to find a good way of doing it efficiently. For example it might involve breaking up a colspan cell into multiple components, so everything from the column "goes with the column". Or should the columns automatically be removed form a colspan, and "go up a level" (as it were) - then should rowspans be broken up?

    So yup, I'm afraid that this is not currently supported. I'll add a note tot he documentation to make this clear.

    Allan
  • jhrabowsjhrabows Posts: 5Questions: 0Answers: 0
    Hi Allen,
    I am a little more optimistic after looking at the code :). The hard work is done by fnColReorder which deals with columns only. The issue is with mapping the TH's to the column indexes and the current logic makes a (very) simplifying assumption that each TR has the same number of TH's (this is what needs to be documented). However, the logic which maps LEAF TH's do the columns is already there (since clicking on a leaf results in sorting the column below). If you restricted the reorder only to the leaf TH's then these would solve a big chunk of scenarios. I agree that solving the case in full generality would be a little more challenging but not impossible, especially if there is something resembling a tree-structure.

    You can also take a look at the competition:

    http://dev.sencha.com/deploy/ext-4.0.0/examples/grid/group-header-grid.html

    It imposes some restrictions but in general allows all that you could reasonably expect.
This discussion has been closed.