Opened 11 years ago

Closed 11 years ago

#7017 closed enhancement (fixed)

dojox.DataGrid: Add ability to show/hide columns via header context menu

Reported by: nathan Owned by: nathan
Priority: high Milestone: 1.2
Component: DojoX Grid Version: 1.1.1
Keywords: Cc: Bryan Forbes
Blocked By: Blocking:

Description

The ability to toggle the state of columns via a header context menu would be really cool! :)

Attachments (5)

grid_toggleColumns.diff (8.5 KB) - added by nathan 11 years ago.
Patch which adds context-menu toggling of columns to the grid.
grid_toggleColumns.2.diff (11.1 KB) - added by nathan 11 years ago.
Updated with test case for how to
grid_toggleColumns.3.diff (15.6 KB) - added by Bryan Forbes 11 years ago.
grid_toggleColumns.4.diff (15.7 KB) - added by Bryan Forbes 11 years ago.
grid_toggleColumns.5.diff (15.8 KB) - added by Bryan Forbes 11 years ago.

Download all attachments as: .zip

Change History (11)

Changed 11 years ago by nathan

Attachment: grid_toggleColumns.diff added

Patch which adds context-menu toggling of columns to the grid.

comment:1 Changed 11 years ago by nathan

Type: defectenhancement

comment:2 Changed 11 years ago by nathan

Status: newassigned

Changed 11 years ago by nathan

Attachment: grid_toggleColumns.2.diff added

Updated with test case for how to

comment:3 Changed 11 years ago by nathan

Duh - let me finish that thought....

The last patch has an updated test case with an example of creating a custom menu, if desired. It creates a custom context menu with toggling as options under a submenu - and it is in effect *anywhere* on the grid - not just the header.

Changed 11 years ago by Bryan Forbes

Attachment: grid_toggleColumns.3.diff added

comment:4 Changed 11 years ago by Bryan Forbes

I uploaded a modified patch. Instead of having a flag, the user must now pass in a dijit.Menu with a dojox.grid.GridColumnsMenuItem? somewhere in it. This seems like a better option API-wise.

Changed 11 years ago by Bryan Forbes

Attachment: grid_toggleColumns.4.diff added

comment:5 Changed 11 years ago by Bryan Forbes

I updated the patch to extend dijit.Menu to add a getPlaceholders method. Eventually Nathan and I would like to move dojox.grid.GridColumnsMenuItem? to dojox.widget.PlaceholderMenuItem?.

Changed 11 years ago by Bryan Forbes

Attachment: grid_toggleColumns.5.diff added

comment:6 Changed 11 years ago by Bryan Forbes

Resolution: fixed
Status: assignedclosed

(In [14193]) fixes #7017 !strict

  • Added the ability to provide a context menu for the grid headers.
  • Moved markupFactory code from DataGrid? to _Grid and added specializations for DataGrid?.
Note: See TracTickets for help on using tickets.