I know TableFields don't support drag-and-drop re-ordering. That would be awesome! (next version, please?)
But until then, I want to add an arbitrary "Sort" field to my DataObjects in a TableField or CTF. Problem is, I'm not sure how to cascade an update if the user assigns a new sort order to an object that is already taken by another object. Don't want to end up with two 3's, for instance.
Anyone have any idea how to do that? I assume this is where onBeforeWrite() is handy, but that's just a guess.
The problem I'm having is making the distinction between the data supplied by the form and the data that was already on the object to begin with.
$this->Sort .. is that the old data or the new data coming in from the form?
Maybe $_POST['Sort'] is what I want?
Also, writing an efficient query seems like another chore. Any ideas?