NSTableView drag and drop too smart for its own good
NSTableView drag and drop too smart for its own good
- Subject: NSTableView drag and drop too smart for its own good
- From: Paul Kim <email@hidden>
- Date: Wed, 13 Sep 2006 12:57:08 -0400
Hi,
I have two table views, one is a source list and the other is a
detail (list of items for that source). Selecting an item in the
source list reloads the data in the detail.
Now I want to be able to drag one detail item into the detail item
for another source. I implemented a spring loaded folders type thing
where if you hover the dragged detail item over a source, it switches
to that source so you can drag the detail item back into the detail
table (which now has different data than when the drag started). The
reason for this is that ordering matters so this would give the user
an opportunity to put it in the exact spot they want. Also note that
they could just drop it on the source and it will add it to the end
of the detail list.
The problem is that it seems like NSTableView sees itself as the
source of the drag, so it won't allow drops at the position of the
original dragged row (thinking it's just a move of a row within
itself). It doesn't even seem to call -tableView: validateDrop:
proposedRow: proposedDropOperation: on my data source when the drag
is over the original row position (even though in my case, the table
has different data so it would make sense to drop it there).
Is there an easy way to work around this or am I stuck re-
implementing NSTableView's drag and drop in a subclass to get this to
work?
Thanks,
Paul Kim
_______________________________________________
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