Hey,
phpist a écrit :
> <ul>
> <li testID="1">Test A</li>
> <li testID="2">Test B</li>
> <li testID="3">Test C</li>
> </ul>
Er, first, you do know that this is not valid HTML, right? A more
scriptaculous'ish option would be to put it like this:
<li><span class="informal">1</span>Test A</li>
...
Then style .informal to "display: none". It will automatically *not* be
used for visual completion of your edit zone, too.
> How can i handle testID?
Use the afterUpdateElement callback, which gets passed the selected <li>
item as its second argument. Then just use readAttribute('testID') on
it. Or if you went with the informal stuff, you can either use:
yourLI.getElementsByClassName("informal").firstChild.nodeValue
or:
yourLI.firstChild.firstChild.nodeValue
The first variant reacts better to change in your <li> structure, but is
slower. The second is faster but structure-dependent.
'HTH
--
Christophe Porteneuve aka TDD
[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---