globexdesigns/doby-grid — pull request #168 by mminer (2014-12-16 23:29:51+00:00)
Title: Add ability to export group

This adds an option to export a group instead of the entire table, as requested in #84.

Before merging in, the UX should perhaps be considered. This adds two options to the _Export_ context submenu: _Export Group to CSV_ and _Export Group to HTML_. These only appear when grouping has been turned on. This works alright, but there's also a _Grouping_ submenu that could also hold these options. The place they appear now makes the most sense to me, but I can move them elsewhere if desired.

Code-wise, the way I tell `export` to only export a group may seem a bit strange. I pass it the row that the group is on then later call `getGroupFromRow` to get the underlying group. Initially I passed the group itself (also retrieved via `getGroupFromRow`) as an argument to `export`, which makes more sense, but when remotely fetching rows these will contain placeholders and you have to "re-get" the group anyway. Getting the group from the clicked row inside `export` is currently the most elegant way to do this.