PDA

View Full Version : align Grid Headers verically



vikaskapoor
9 Jan 2012, 5:38 AM
Hi,

Is there any possible way to align the Grid Headers vertically/

My requirement is to have a grid with all its headers align on the left and the corresponding data columns also such that each new row is aligned vertical.


Thanks,

findajit
9 Jan 2012, 6:08 AM
@vikas

The grid panel does not offer this functionality, out-of-the-box. In case you need this, you will have to extend the grid panel

vikaskapoor
9 Jan 2012, 6:10 AM
Ajit,

I have the requirement to implement the grid panel in such a way
Can you please guide me how to approach?


Thanks,

findajit
9 Jan 2012, 6:50 AM
What are the features you require on your grid with vertical headers? sorting? filter? summary? row body? grouping?

vikaskapoor
9 Jan 2012, 6:51 AM
i need just the local sort and nothing else

findajit
9 Jan 2012, 3:22 PM
@vikas,

start looking at the Ext.view.TableChunker code and look at the XTemplates - metaTableTpl and metaRowTpl - used to render the tables for the grid. You will have to start by modifying the XTemplate, which will help you to render the header vertically.

vikaskapoor
10 Jan 2012, 5:49 AM
@ajit,

I am working on a grid which automatically refreshes after a particular interval of time and loads the updated data from server.

So, is there any way such that I can design the grid and store in such a way that every time the grid refreshes rather than a row a new column is being appended.

To achieve this I am using grid.reconfigure() to create a new grid every time.

Is this way of approaching the problem is good enough?
Also if anything I can improve over in this approach please let me know.


thanks,

findajit
11 Jan 2012, 4:08 PM
@vikas,

if you don't wanna take the approach of defining a new component as suggested above, reconfigure approach sounds reasonable.

vikaskapoor
12 Jan 2012, 3:42 AM
@ajit,

i have implemented the grid using reconfigue approach, but now I wanted to implement paging in the grid and for that I am using paging toolbar.
but i need to reconfigure the grid on the next button and previous button click of paging toolbar, is it possible to reconfigure the grid while paging?


thanks,

findajit
12 Jan 2012, 4:14 AM
Yes. You can override Ext.toolbar.Paging and implement the following methods:

moveFirst
moveNext
movePrevious
moveLast
doRefresh

With this you shall be able to take care of specific behaviours

vikaskapoor
23 Jan 2012, 12:55 AM
@ajit,

I have implemented the Grid in Vertical headers way, but I need a feature from where I can freeze my first column in the grid such that the horizontal scrollbar appears from the second column and should scroll only for the data and not the headers column along.

I tried" locked: true" in the column model but that is not working either.
And also sometimes I found a behavior that which paginating the grid the scrollbar remains at the same position and the scrolling doesnt happen properly.

Can you please suggest?


thanks,