EasyUI Forum
July 19, 2025, 07:06:14 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to hide the treegrid icon  (Read 2238 times)
btork
Newbie
*
Posts: 11


View Profile
« 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
Logged
jarry
Administrator
Hero Member
*****
Posts: 2294


View Profile Email
« Reply #1 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)
    }
})
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!