Go Back   SmartClient Forums > Smart GWT Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 15th Oct 2009, 17:28
mmfish mmfish is offline
Registered Developer
 
Join Date: Oct 2009
Posts: 1
Default Horizontal scrollbar for treegrid cannot show up when having the Zindex set

Hi, I am now configuring the horizontal scrollbar in a treegrid by setting the TreeGrid to autofitdata with 'overflow' set to auto. I have also included an 'expand all' link.

I met two problems during the process.

1. I found the horizontal scrollbar doesn't show up if i set the ZIndex in the layout. But I do need to set the Zindex or my page menu would be overlapped by the tree.

Code:
public void onModuleLoad() {
		final TreeGrid listGrid = createListGrid(PortfolioHierarchyDataSource.getInstance());

		HLayout layout = new HLayout();
		layout.setWidth100();
		layout.setHeight100();
		layout.setMembers(listGrid);
		//layout.setZIndex(0); ===== if this line is commented out, the horizontal scroll bar works fine, else the scroll bar doesn't show as expected.
		layout.setOverflow(Overflow.AUTO);

		RootPanel.get("portfolioHierarchyDivId").add(layout);

	}

private TreeGrid createListGrid(DataSource portfolioHierarchyDs) {
		listGrid = new TreeGrid() {
		};
		
		listGrid.setDataSource(portfolioHierarchyDs);

		ListGridField nameField = new ListGridField("name", "Name");
		nameField.setType(ListGridFieldType.LINK);
		
                listGrid.setFields(nameField);

		listGrid.setLoadDataOnDemand(false);
		listGrid.setAutoFetchData(true);
		listGrid.setHeight100();
		listGrid.setWidth100();
		
		listGrid.setZIndex(1);
		listGrid.setAlternateRecordStyles(true);
		listGrid.setResizeFieldsInRealTime(Boolean.TRUE);
		
		listGrid.setAutoFitData(Autofit.BOTH);			
		listGrid.sort("name", listGrid.getSortDirection());
		
                return listGrid;
	}
2. Although a horizontal scrollar bar shows up, the first time I hit 'expand all' on the page, it doesn't move enough to see the whole tree. only after the second time when I hit 'expand all', the whole tree could be displayed.


Would you please take a look when you have a chance? It's really an urgent case in our project.


Thanks a lot in advance
Reply With Quote
  #2  
Old 15th Oct 2009, 20:26
Isomorphic Isomorphic is online now
Administrator
 
Join Date: May 2006
Posts: 30,561
Default

Don't set overflow on the TreeGrid. Use a containing element (a VLayout would do) with overflow:auto instead.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved