Opened 8 years ago

Closed 8 years ago

#9937 closed enhancement (fixed)

Tree: Extend dijit.Tree to allow styling of complete row

Reported by: Shane O'Sullivan Owned by: Shane O'Sullivan
Priority: high Milestone: 1.4
Component: Dijit Version: 1.3.2
Keywords: Cc: nonken
Blocked By: Blocking:

Description

The dijit.Tree widget currenltly allows the user to apply styles to labels and icons, but there is no facility for adding a CSS class to the rowNode.

The prevents customizations such as varying backgrounds on a per-node basis.

The solution would be similar to that used for icons:

  1. Add a function 'addRowClass' to the tree, which users can override.
  2. Change the '_updateItemClasses' on dijit._TreeNode to use this function to get the CSS class to apply to the rowNode

Attachments (1)

dijit.Tree.rowClass.patch (2.6 KB) - added by Shane O'Sullivan 8 years ago.
Patch to resolve this issue. I refactored the dijit._TreeNode a little, as it was duplicating the same process 3 times.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 8 years ago by Shane O'Sullivan

Correction: the function should be called 'getRowClass', not 'addRowClass'

comment:2 Changed 8 years ago by bill

Sounds reasonable, go ahead if you want to patch that. I sort-of regret adding getIconClass() and getLabelClass() since all could be achieved from this one new method, but too late now.

Changed 8 years ago by Shane O'Sullivan

Attachment: dijit.Tree.rowClass.patch added

Patch to resolve this issue. I refactored the dijit._TreeNode a little, as it was duplicating the same process 3 times.

comment:3 Changed 8 years ago by bill

Milestone: tbd1.4
Owner: set to Shane O'Sullivan
Summary: Extend dijit.Tree to allow styling of complete rowTree: Extend dijit.Tree to allow styling of complete row

Great, looks good to me.

comment:4 Changed 8 years ago by Shane O'Sullivan

Resolution: fixed
Status: newclosed

Changes made in [20363]. Not sure why the reference is not showing up in this ticket.

Note: See TracTickets for help on using tickets.