Announcement

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

    treegrid autofit:horizontal

    Using SmartClient Version: v8.2p_2013-03-04,
    and running with data from isomorphic/system/reference/SmartClient_Explorer.html#treesEditing

    Run the testcase. Start expanding the tree. The vertical scrollbar shows but horizontally, there is no scrollbar. I would like to at the very minimum, have a scrollbar grow depending on the data that is being shown on the tree horizontally. Ultimately, I want to be able to autofit the data horizontally when expanded up the 500px. Once the 500px is reached, then the scrollbar will show. Right now I only see this happening if I resize the column manually.

    Is there any way to do this?

    Code:
    isc.TreeGrid.create({
        ID: "employeeTree",
        width:150,
        height: 250,
        dataSource: "employees",
        autoFetchData: true,autoFitMaxWidth:500,autoFitMinWidth: 200, autoFitData: "horizontal",overflow:"scroll",
        canEdit: true,
        canReorderRecords: true,
        canAcceptDroppedRecords: true,
        nodeIcon: "icons/16/person.png",
        folderIcon: "icons/16/person.png",
        showOpenIcons: false,
        showDropIcons: false,
        closedIconSuffix: "",
        fields: [
            {name: "Name"}
        ]
    });

    #2
    ListGrid (and TreeGrid) fields do not automatically expand to fit their data by default.

    In SmartClient 8.3 we introduced a property "autoFitFieldWidths" (or for individual fields "autoFitWidth") which adds support for this feature. This functionality is not available in 8.2 (and will not be practical to attempt to backport, unfortunately - it's fairly complex).
    There isn't an obvious way to achieve the same thing at the application level.
    For limited cases you could potentially write some application logic which reacts to "dataChanged" or similar on a treegrid, looks at how many levels of content are visible, and adjusts the size of the treefield via an explicit resizeField(...) call. You'd have to essentially estimate the required size based on the depth of nesting exposed within the tree.

    If upgrading to 8.3 is an option we'd definitely recommend that over attempting to build your own parallel functionality into an app.

    Regards
    Isomorphic Software

    Comment

    Working...
    X