EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: btork on May 21, 2025, 09:05:19 PM



Title: How to hide the treegrid icon
Post by: btork on May 21, 2025, 09:05:19 PM
Hello,
I want to hide the expand icon for a treegrid for the entire table. I want the user to be able to expand by clicking on the entire row. Is this possible?

-btork


Title: Re: How to hide the treegrid icon
Post by: jarry on May 24, 2025, 06:16:45 AM
Add the CSS style to hide the expanding/collapsing icon on the treegrid.
Code:
<style>
    .mytg .tree-hit{
        display: none;
    }
</style>

And then listen to the 'onClickRow' event, call the 'toggle' method to expand or collapse the node.
Code:
$('#tg').treegrid({
    cls: 'mytg',
    onClickRow: function(row){
        $(this).treegrid('toggle',row.id)
    }
})