maccode - locking table columns to a specific position
Monday, February 19th, 2007I meant to post about this a couple days ago when I originally wrote it, but I’ve had a lot going on so I didn’t get to blogging about it until now.
I recently added a new sample project to the maccode repository (in Snippets -> TableViews) that illustrates Apple’s Technical QA #1503, preventing table column reordering. Apple’s sample is hard-wired for a column named “FirstName” and I felt it was good for illustration, bad for reuse.
The reordering delegate in my sample allows you to specify an array of column identifiers and an array of positions to match. Whenever a column is dragged the anchored column[s] will restore themselves and suppress drags from their column headers. The first place I noticed such behavior was in iTunes, but I can see it being useful in general (for checkbox and icon columns, etc.)
Be sure to head over to the Google Code repository and give it a drag! (BSD-licensed for those who care)