This altered version of the initExpander code will add the expand action to the title of each treenode:
( makes it much easier to use, don't know how to add this to code, sorry )
initExpander: function() {
var $this = $(this);
var cell = $this.find('td').get($this.treegrid('getSetting', 'treeColumn'));
var tpl = $this.treegrid('getSetting', 'expanderTemplate');
var expander = $this.treegrid('getSetting', 'getExpander').apply(this);
if (expander) {
expander.remove();
}
$(tpl).prependTo(cell).click(function() {
$($(this).closest('tr')).treegrid('toggle');
});
// %%%%%%%%%% added these lines %%%%%%%%%%%%%%%
$(cell).find(".title").click(function () {
$($(this).closest('tr')).treegrid('toggle');
});
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
return $this;
},
This altered version of the initExpander code will add the expand action to the title of each treenode: ( makes it much easier to use, don't know how to add this to code, sorry ) initExpander: function() { var $this = $(this); var cell = $this.find('td').get($this.treegrid('getSetting', 'treeColumn')); var tpl = $this.treegrid('getSetting', 'expanderTemplate'); var expander = $this.treegrid('getSetting', 'getExpander').apply(this); if (expander) { expander.remove(); } $(tpl).prependTo(cell).click(function() { $($(this).closest('tr')).treegrid('toggle'); }); // %%%%%%%%%% added these lines %%%%%%%%%%%%%%% $(cell).find(".title").click(function () { $($(this).closest('tr')).treegrid('toggle'); }); // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% return $this; },