View Full Version : TreeGrid fixed row header
15 Oct 2009, 9:22 PM
is it possible to "fix" the first n (n=1 would be enough) columns of a TreeGrid or Grid to prevent them from scrolling horizontally? This would turn the first n columns to fixed row headers.
Has anyone done this before?
Thanks for any help.
4 Nov 2011, 7:41 AM
nearly two years on exactly.... has anyone got any idea how to implement fixed row headers for a tree
4 Nov 2011, 10:19 AM
I'm going to address this from the perspective of Grid, which is slightly easier to address - nothing to expand and collapse, but in the end, that is just another detail to work out.
From two minutes of considering this, here is the basic issue you'll face: the browser's understanding of how to build scrollable block elements - you can't ask it to make a single container (grid viewport) that contains two different scrollable containers that scroll together. You'll need to heavily modify the Grid and GridView to make this happen. It is possible that GXT 3 will make this easier to accomplish, but it isn't a deliberate design goal.
I have seen this done though! Two Grids, side by side, with a listener for scroll events on the rightmost grid, and the scrollbar hidden for the other. The listener watched as the user scrolled, and directed the other to scroll the exact same amount. Both were tied to the same ListStore, and just had different sets of columns.
Adding back in the TreeGrid aspect: you'll need a way to listen to expand on one, and apply it to the other. There may be (probably are) other issues that will come into the picture here, but as you try to build this, you'll encounter them: if you can share what you've built when they come up (and how it works), the community can probably help you past them.
8 Nov 2011, 12:41 AM
thanks for your reply, I will try and implement some of your suggestions, I was hoping for an easier solution, I think this would be a really useful function.
5 Apr 2012, 5:32 AM
Hi, I am trying to do the same thing, with two grids using same list store and with listener listening to onscroll events on one grid. However I am stuck at hiding the scroll bar of the left grid. Has anyone done this before?
Powered by vBulletin® Version 4.1.5 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.