Add and Edit a table row
Add and Edit a table row
- Subject: Add and Edit a table row
- From: Pete Bates <email@hidden>
- Date: Tue, 7 Mar 2006 07:39:50 -0700
In an editable table, when the user tabs out of the last cell, rather
than wrapping to the table's first cell, I would like to add a new
row and edit the first cell of the new row. I have tried subclassing
the window to catch the keydown event then adding an object to my
datasource for the table, reloading the table data, and using –
editColumn:row:withEvent:select: to edit the leftmost new cell. This
approach has two problems: first, the window in question will have 3
such tables. How do I know from which table the keyDown event
originated? Do I need an"activeTable" ivar to track this... seems
kind of kludgy. The second issue is that I have not been able to
select the desired cell for editing using
editColumn:row:withEvent:select: Instead, the entire (former) last
row is selected. Now the table view and data source both have the
additional (row/data object) added, and I can manually select and
edit the new row.
Doesn't seem like this is such a novel idea, but I haven't been able
to locate a prior solution. If anyone has an answer, a suggestion,
or can point me to a previous discussion, I'd appreciate it. Thanks.
Pete _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden