Re: Two NSTableViews acting as one
Re: Two NSTableViews acting as one
- Subject: Re: Two NSTableViews acting as one
- From: The Karl Adam <email@hidden>
- Date: Wed, 2 Nov 2005 17:23:24 -0500
Well another approach you could take is to write a value transformer
that merely took the selectionIndex and through some logic on your
part would caclculate the selected row. ie. top tableview could have
16 items and you'd use counts greater than 16 to set no selection on
the first tableview and n-16 on the second table view.
This of course assumes you have the table views arranged one on top of
the each so that this makes some sense.
-Karl
On 11/2/05, Jason Bell <email@hidden> wrote:
> This keeps the selectionIndexes synchronized between the tables.
> Selecting row two in the first table automatically selects row two in
> the second table. This is unfortunately not what I'm after. One and
> only one row should be selected from "the list" which is made up of
> the two tables. It should appear as though it's just one table view
> with "allows empty selection" unchecked.
>
> - Jason
>
>
> On Nov 2, 2005, at 2:52 PM, The Karl Adam wrote:
>
> > Bind selectionIndexes of both tableViews to the arrayController's
> > selectionIndexes. Now your selections will be seamless across both
> > tables at all times.
> >
> > -Karl
> >
> > On 11/2/05, Jason Bell <email@hidden> wrote:
> >> In the UI for the next release of my app, I have a space that appears
> >> to be one list of items. However, it is actually a fixed list
> >> followed by a separator bar and then a dynamic list (similar to the
> >> left side of the finder). I implemented this using two NSTableViews,
> >> each bound to an array controller. The problem is that even though
> >> they are two separate table views, they need to behave together like
> >> one table view that does not allow a multiple or empty selection. I
> >> got most of the way there using a combination of
> >> selectionShouldChangeInTableView, tableViewSelectionDidChange, and
> >> some toggling of setAllowsEmptySelection. However, there always
> >> seems to be a way to trip it up and get to a point where nothing
> >> appears selected or something appears as selected in both lists.
> >>
> >> I'm stating to think there might be a cleaner way to accomplish this
> >> goal. I'm relatively new to bindings so perhaps I'm making things
> >> overly difficult in how I am using my table view delegate to change
> >> the current selection in the array controllers. Not necessarily some
> >> code but any thoughts about a different way to approach this would be
> >> much appreciated.
> >>
> >> Thanks,
> >> Jason
> >>
> >> _______________________________________________
> >> Do not post admin requests to the list. They will be ignored.
> >> Cocoa-dev mailing list (email@hidden)
> >> Help/Unsubscribe/Update your Subscription:
> >> 40gmail.com
> >>
> >> This email sent to email@hidden
> >>
>
>
_______________________________________________
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