jQuery UI Widgets Forums TreeGrid [Bug] TreeGrid Container height is not recalculated if cell expand after edit

This topic contains 2 replies, has 2 voices, and was last updated by  Christopher 7 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • ratchetclank
    Participant

    Hi,

    I’ve located a bug in the treegrid component :

    If you edit inline a treegrid row, and if your text is too long to fit inside the cell, the text will wrap, increasing the height of the cell. However, the overall height of the treegrid will not increase, truncating the last line(s). The component seem to recalculate the good height if you insert a row or if you collapse/uncollapse a branch of the treegrid.

    You can try it here : http://jsfiddle.net/Vq76M/21/
    Just edit a cell and input more than the cell width, you will see it directly !

    A call to the refresh or render function don’t have any effect…

    I’m still trying to find a workaround.


    ratchetclank
    Participant

    Ok, I found a workaround but it’s a VERY UGLY one :

    
    let resetHeigthLock = false;
    
    $("#myDataGrid").on('rowEndEdit', function (event) {
        if (!resetHeigthLock) {
            resetHeigthLock = true;
            setTimeout(function () {
                $("#myDataGrid").jqxTreeGrid('addRow', "resetHeigth", {}, 'last', null);
                $("#myDataGrid").jqxTreeGrid('deleteRow', "resetHeigth");
                setTimeout(function () {
                    resetHeigthLock = false;
                }, 50);
            },
            50);
        }
    });
    

    Basicly on the rowEndEdit event, I manually add and remove a line for the component to recalculate his heigth.
    Here you need to use a timeout function because it seem for an unknonw reason the deleteRow function trigger the rowEndEdit event, leading to an endless loop and a stack overflow.

    This is still a big bug but at least it can be circonvented somehow…

    • This reply was modified 7 years, 2 months ago by  ratchetclank.
    • This reply was modified 7 years, 2 months ago by  ratchetclank.
    • This reply was modified 7 years, 2 months ago by  ratchetclank.

    Christopher
    Participant

    Hi ratchetclank,

    Thank you for your feedback. You could set the autoRowHeight property to “false” so the height of the cell won’t change.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.