I’ve been having trouble with a Scriptaculous sortable object that wasn’t catching the onUpdate function I’d assigned. In this case, I was using an UL for the parent with LIs inside. After digging into the code, I discovered that there are several criteria that must be for the actual items that are going to be sortable, or else the event won’t fire. These are:
- Each item must have a unique id.
- The item id must contain an underscore (_)
- The item id cannot begin with an underscore or a hyphen
Using myname_## should work fine, as long as ## is a unique integer in each case. Technically, it must match the following regular expression:
/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/