Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by John on Jan 20, 2008 06:57
open dhtmlx forum
Split at Column x but have initial grid scroll horizontal automatically to column 4

I am displaying a Tree in the first column and then 12 months of data and want to auto scroll to the column showing the current months data whilst using the splitat(1) to keep the tree in view

e.g. grid looks like

Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Tree

and I want it to initially show

Apr May Jun Jul Aug Sep Oct Nov Dec
Tree


Is this possible?
Answer posted by Support on Jan 21, 2008 05:38
You can use split at position 1 to made grid always visible and to scroll right part of grid to necessary column one of next solutions

a) If at least one row exists in grid, and you know its ID

    grid.selectCell(0,4);
    grid.clearSelection();

the select Cell will force auto-scroll to cell in question

or

b) You can set necessary scroll value manually

    grid.loadXML(url,function(){
       grid.objBox.scrollLeft=some+"px";   //set horizontal scrollbar state
    });