jquery-treegrid icon indicating copy to clipboard operation
jquery-treegrid copied to clipboard

Ability to click not only the glyph but the whole word to expand the tree

Open e-designer opened this issue 9 years ago • 4 comments

It's hard to target the glyph in small devices (small screen). Is there any way to be clickable all the word to expand the subtrees?.

Tnx Chris

e-designer avatar May 07 '15 09:05 e-designer

Hi,

I've had the same issue and I did like this :

$(".tree tr").on("click", function(event){ $(this).treegrid('toggle'); });

When the user click on the table row, the tree expand / collapse !

crabepet avatar May 18 '15 09:05 crabepet

it like that $(".tree>tbody>tr>td:first-child").on("click", function(event){ var tr = $(this).parent(); $(tr).treegrid('toggle'); });

sg157 avatar Dec 17 '15 08:12 sg157

Hi - I'm not very familiar with JS - how do I implement this? Where do I have to place the code? Thanks for help. Frank

perlfan2009 avatar Jul 08 '16 13:07 perlfan2009

@perlfan2009 you put it where you init your treegrid. Here an example:

            <script type="text/javascript">
                $(document).ready(function() {
                    $('.tree').treegrid();
                    $(".tree tr").on("click", function(event){
                        $(this).treegrid('toggle');
                    });
                });
            </script>

ChargingBulle avatar Sep 09 '16 10:09 ChargingBulle