• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTableView Drag-Drop re-ordering...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView Drag-Drop re-ordering...


  • Subject: Re: NSTableView Drag-Drop re-ordering...
  • From: Jean-Nicolas Jolivet <email@hidden>
  • Date: Wed, 26 Nov 2008 03:47:46 -0500

Thanks a lot Chaitanya... exactly the kind of info i was looking for! :)


On 26-Nov-08, at 3:41 AM, chaitanya pandit wrote:

To re-order the items in the tableView, you will have to implement a custom drag type.
Say for example you name your custom drag type as @"myDragType"
then
1] Register your table view to accept this drag type using "registerForDraggedTypes:" and passing an array containing @"myDragType" along with super's drag types
2] In your tableView's data source, implement this method "tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes :" and return an array containing @"myDragType".
3] Implement "tableView:writeRowsWithIndexes:toPasteboard:" in your data source and write any dummy data in the given pasteboard for type @"myDragType", this can be the data representing the items/ indexes being dragged
4] Check for a valid drop with "tableView:validateDrop:proposedRow:proposedDropOperation:"
5] Finally set the new indexes for the dragged items in "tableView:acceptDrop:row:dropOperation:"
HTH,
Chaitanya


On 26-Nov-08, at 1:36 PM, Jean-Nicolas Jolivet wrote:

As I said... I have no problems with dragging files on the data table... my table is already a drag destination and its working well...with the bindings in place etc...

What I can't find is good info about re-ordering the table row with drag and drop, and I did search google for the obvious key words (NSTableView drag drop order, NSTableView re-order etc etc..)

But thanks anyway...


On 26-Nov-08, at 2:58 AM, mmalcolm crawford wrote:


On Nov 25, 2008, at 11:26 PM, Jean-Nicolas Jolivet wrote:

I'm pretty sure this has been covered before, however I can't find any good examples on how to implement it??

<http://www.google.com/search?client=safari&rls=en-us&q=nstableview+drag+drop+bindings&ie=UTF-8&oe=UTF-8 >
<http://www.google.com/search?client=safari&rls=en-us&q=table+view++drag+drop+bindings&ie=UTF-8&oe=UTF-8 >


mmalc



Jean-Nicolas Jolivet email@hidden http://www.silverscripting.com

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


Jean-Nicolas Jolivet email@hidden http://www.silverscripting.com

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSTableView Drag-Drop re-ordering... (From: Jean-Nicolas Jolivet <email@hidden>)
 >Re: NSTableView Drag-Drop re-ordering... (From: mmalcolm crawford <email@hidden>)
 >Re: NSTableView Drag-Drop re-ordering... (From: Jean-Nicolas Jolivet <email@hidden>)
 >Re: NSTableView Drag-Drop re-ordering... (From: chaitanya pandit <email@hidden>)

  • Prev by Date: Re: NSTableView Drag-Drop re-ordering...
  • Next by Date: Re: How to use IB to create a viewcontroller which actually linking to another nib file?
  • Previous by thread: Re: NSTableView Drag-Drop re-ordering...
  • Next by thread: Re: NSTableView Drag-Drop re-ordering...
  • Index(es):
    • Date
    • Thread