brendand / mbtablegrid

An NSControl subclass which provides a spreadsheet-style table grid
9 stars 3 forks source link

Add support for isGroupRow #17

Closed brendand closed 9 years ago

brendand commented 10 years ago

NSTableView has an isGroupRow delegate which returns a BOOL if the current row should span across all columns and be drawn using a different style than the rest of the rows.

For example:

- (BOOL)tableView:(NSTableView *)tableView isGroupRow:(NSInteger)row {
    BOOL isGroupRow = NO;
    // do something to determine from your model if the current row
    // is a section header (or group row)
    return isGroupRow;
}

It should also prevent selecting of cells in isGroupRow rows.

screen shot 2014-11-03 at 10 20 38 pm

brendand commented 9 years ago

Updated the sample app so row 0 and row 5 are designated as group rows. Just randomly picked those values.

Dejal commented 9 years ago

Might want to consider supporting floating group rows. (See -addFloatingSubview:forAxis:.) Probably not trivial, though.