mbtablegrid icon indicating copy to clipboard operation
mbtablegrid copied to clipboard

Handling empty grids and changes to the number of rows & columns

Open ghost opened this issue 11 years ago • 6 comments

I’ve created a branch called ‘emptytable’ with some changes to MBTableGrid so that it is able to handle empty grids and changes to the number of rows & columns, especially when rows & columns are removed.

Comments are welcome.

One thing that I think we should do is to review selected{Row,Column}Indexes for no selection. I see there’s code that assumes that -firstIndex and -lastIndex are always valid, but that’s not the case when we have an empty grid. In -[MBTableGrid initWithFrame:], these index sets default to index 0. Should we change them to empty sets and review all code that uses them?

ghost avatar May 03 '14 07:05 ghost

Another option regarding empty selection indexes: if there is at least one cell, force at least one selected row and one selected column—this matches current behaviour. Selected row (column) indexes are empty if and only if there are no rows (resp. columns), so any method that inspects -firstIndex or  -lastIndex only needs to make sure that the grid is not empty.

I’ll work on implementing this throughout the code base in the emptytable branch.

ghost avatar May 08 '14 08:05 ghost

I believe the emptytable branch is ready to be merged into master, but I could definitely use more eyes. I’ll wait for two weeks before merging.

ghost avatar May 13 '14 06:05 ghost

Hi, I can take a look at this in the first week of June - sounds excellent!

mikecsh avatar May 19 '14 16:05 mikecsh

Midweek ping!

ghost avatar Jun 05 '14 07:06 ghost

Pinging for news :)

DivineDominion avatar Apr 15 '16 07:04 DivineDominion

@bavarious @DivineDominion Hi both, I'm afraid I no longer have any free time to spend on mbtablegrid, especially considering I'm not using it in any apps. My suggestion would be to use either one of the much more advanced and maintained forks from @brendand or @pixelspark - good luck!

mikecsh avatar Apr 15 '16 08:04 mikecsh