Hi all,
I've run into a problem that surprised me a bit.
I've got a table of items, where each <tr> tag is assigned a specific ID.
For example:
<table>
<tr id="node-123">
...
</tr>
<tr id="node-456">
...
</tr>
</table>
On that same page is a form. When the user clicks on a node in the table, an Ajax.Request is made, values are returned via X-JSON header, and I then use the onSuccess callback to populate the form with the X-JSON values.
The user can then change the values of the node, and click "Save" ... an Ajax.Request posts the form back to the server, and upon
successfully saving the changes, an X-JSON header is set with the new
data.
All working well.
What is NOT working: The X-JSON response from the post back to the server contains an id number. I'm trying to take that ID, combine it with "node-", and highlight the row in the table to indicate that the change took place.
If I manually do:
new Effect.Highlight('node-123');
... the row flashes as expected.
On the other hand, if I do:
nodeid = 'node-' + json.id;
new Effect.Highlight
(nodeid);
... nothing happens.
I've also attempted:
new Effect.Highlight($(nodeid));
... which doesn't work either.
I'm stumped on this one. I've already checked (typeof nodeid) is a string, and that its value is 'node-123'. So ... why wouldn't the highlight effect be working?
I'm truly baffled. Anyone have an idea?
Thank you,
Clay
--
Killersoft.com
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
- [Rails-spinoffs] Highlighting JSON-defined id Killersoft
