Opened 11 years ago

Closed 11 years ago

#12245 closed task (invalid)

Can DataGrid column header be formatted dynamically like the row can?

Reported by: gregorokorn Owned by: bryanforbes
Priority: high Milestone: tbd
Component: DojoX Grid Version: 1.6.0b1
Keywords: datagrid headers format Cc: [email protected]
Blocked By: Blocking:


My DataGrid? has many columns that show count values, and our customer's requirement is for the header of each column to show the total of the counts in that column. The DataGrid? is populated via AJAX so whenever the table changes I easily have the opportunity to reset the column label accordingly, but the problem comes when the user sorts a column or resizes a column width. Both of those actions causes the column headers to be reset to their initial labels. The initial labels are set like "<label id=\"safetyAuditCount\"># Safety Audits ()</label>" so that when the grid data is refreshed in a controlled manner, I can access the innerHTML of safetyAuditCount and update the label. I looked for specific event handlers for sorting or resizing of columns to do the update then, but don't see events for those actions. Is there a way to keep the grid headers properly updated? Thanks for your help, Gregor

Change History (2)

comment:1 Changed 11 years ago by gregorokorn

I've since learned a more appropriate way to achieve the results I want. Instead of relying on keeping the rendered <label> in the header cell updated I know now that the better approach is to update the "" on the DataGrid?'s layout structure. Updating the datagrid.layout.cells[i].name property results in the header text being maintained like I wanted. This ticket can be canceled/closed. Thanks, Gregor

comment:2 Changed 11 years ago by Bryan Forbes

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.