Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SectionStack with overflow "auto" and section header resizing

    Hello,

    I am using SmartClient Version: v8.3p_2013-03-13/Pro Deployment and I have a SectionStack with a couple of buttons in the section header and a ListGrid as part of the contents. When the section is resized to be smaller than the ListGrid width, a horizontal scrollbar appears as expected since I have overflow set to "auto".
    However, the section header does not seem to be resized. When I scroll to the right, the header background doesn't extend all the way to match the section content width (see attached snapshot). Is there some way to make the header have the same width as the section content?

    Below is the simple reproducible sample:

    Code:
    <%@ taglib uri="/WEB-INF/iscTaglib.xml" prefix="isomorphic" %>
    <HTML><HEAD>
    	<isomorphic:loadISC skin="Enterprise"/>
    	</style>
    </HEAD>
    
    <BODY>
    
    <SCRIPT>
    
    <isomorphic:loadDS ID="supplyCategory"/>
    <isomorphic:loadDS ID="supplyItem"/>
    
    isc.TreeGrid.create({
        ID: "categoryTree",
        width: "30%",
        showResizeBar: true,
        dataSource: "supplyCategory",
        nodeClick: "itemList.fetchData({category: node.categoryName})",
        selectionType: "single",
        autoFetchData: true
    });
    
    isc.ListGrid.create({
        ID: "itemList",
        dataSource: "supplyItem",
        width: 800,
        fields : [
            { name:"itemName" },
            { name:"SKU" },
            { name:"unitCost", width:50 },
            { name:"units", width:40 }
        ],
        selectionType: "single"
    });
    
    isc.Button.create({
    	ID: "printButton",
    	title: "Print",
        click:function () {
            layout.showPrintPreview()
        }
    });
    
    isc.SectionStack.create({
    		ID: "section",
    		overflow: "auto",
    		sections: [
    			{ items:itemList, title: "", controls:[printButton], expanded:true, canCollapse: false }
    		]
    	});
    
    isc.HLayout.create({
    	ID: "layout",
    	position: "absolute",
    	width: "100%",
    	height: "100%",
    	redrawOnResize: true,
    	members: [ categoryTree, section ]
    });
    </SCRIPT>
    </BODY></HTML>
    Thanks.
    Attached Files

    #2
    Layouts will not, in general, size to the member with the largest breadth. This can create runaway loops as width and height are related for any widget with flowing content.

    You need to explicitly tell the SectionStack to take on the same width as the grid if you want to have the headers be as wide as the grid. If the grid is changing size, use the resized() event.

    Comment


      #3
      Thanks. The ListGrid is calculating its width dynamically. I have autoFitData = "both", autoFitFieldWidths = true and autoFitWidthApproach = "both".
      In the SectionStack's resized() event handler, how do I get the calculated width of the list grid? If I just set the width of the SectionStack to the width of the ListGrid, it shows up as really small, probably because the data hasn't been drawn on the screen yet.

      Comment


        #4
        To get to a component's width in general, you use getVisibleWidth(). However you want to implement the resized() handler on the ListGrid, not the SectionStack.

        The point here is to notice the ListGrid resize and have the SectionStack match its width.

        Comment

        Working...
        X