treegrid onSelect: function (row) { (row.state == "closed") ? $(this).treegrid('expand', row.id) : $(this).treegrid('collapse', row.id); }treeonSelect:function(node){$(this).tree(node.state === 'closed' ? 'expand' : 'collapse', node.target); }