Re: Bindings & NSTableView: setting cell as 'editable' based on another property
Re: Bindings & NSTableView: setting cell as 'editable' based on another property
- Subject: Re: Bindings & NSTableView: setting cell as 'editable' based on another property
- From: Andrew White <email@hidden>
- Date: Thu, 02 Jun 2005 14:49:49 +1000
Lee Morgan wrote:
How about binding the table column to something like...
Bind: "editable" (and / or "enabled")
Bind to: arrayController
Controller Key: arrangedObjects
Model Key Path: isActive
You can invert a boolean using the 'NSNegateBoolean' value transformer
in the binding.
As for doing this per *cell* - as far as I know it isn't possible in
IB. However if you bind your column as stated above, then each "cell"
will have their own "isActive" variable - contained by the array.
I tried that.
NSTableColumn Info (bindings)
value = arrangedObjects.name [MyArrayController]
editable =
NSNegateBoolean (arrangedObjects.isActive) [MyArrayController]
The entire column is set non-editable. This applies whether the first row
isActive or not.
Update: tested things out. Turns out that the column as a whole needs to
be set editable, at which point the editable / non-editable settings of the
cells flow through.
Thanks for your help. :)
--
Andrew White
--------------------------------------------------------------------------
This email and any attachments may be confidential. They may contain legally
privileged information or copyright material. You should not read, copy,
use or disclose them without authorisation. If you are not an intended
recipient, please contact us at once by return email and then delete both
messages. We do not accept liability in connection with computer virus,
data corruption, delay, interruption, unauthorised access or unauthorised
amendment. This notice should not be removed.
_______________________________________________
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