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: Lee Morgan <email@hidden>
- Date: Thu, 2 Jun 2005 00:25:44 -0400
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.
Hope that made sense, it's getting late,
- Lee
On Jun 2, 2005, at 12:09 AM, Andrew White wrote:
I have a table view, in which the entries can either be 'active' or
'inactive'. I'd like to set it up so that the user can only edit
the name of an 'inactive' entry.
Is it possible to use bindings to set the editability of particular
cells in a column, and how would I set this up?
For example:
NSArrayController bound to entries
Entry properties:
name (name, setName)
isActive (isActive)
I can easily set the underlying code up so that setName only works
when isActive is true, but I'd like the interface to work the same
way.
Can I work things so that the 'editable' property of the name
*cell* (not column) is tied to the (negation of the) corresponding
isActive property? How do I express this in IB?
_______________________________________________
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