Hi,
I need some help again. :-)
I have "Too much recursion error" prototype.js line 1288,
I heve this error when I try to use Effect.dropout (script.aculo.us)
if I remove table ID, there is no error, and the effect works fine
(remove the tr from table)
But I need this ID assign to this table, as table ID is used by other
effect (Builder.node)
Please help ....
Thanks
YUAN
Here is the table :
<table width="75%" border="1" cellspacing="2" cellpadding="2" id="listStaff">
<tr>
<th colspan="4" nowrap><div align="left"><a href="#"
onClick="getAddNewStaffForm()">Add New Staff</a></div></th>
</tr>
<tr>
<th nowrap>Staff</th>
<th nowrap>On Going Project</th>
<th nowrap>Total Project</th>
<th nowrap>Action</th>
</tr>
<!-- BEGIN stafflist -->
<tr id="div{userID}">
<td>{name}</td>
<td>{onGoingProjectNumber}</td>
<td>{totalProjectNumber} </td>
<td><a href="#" onClick="getDetailOnGoingProject('{userID}')">list
project</a> <a href="#"
onClick="deleteUser('{userID}')">delete</a> </td>
</tr>
<!-- END stafflist -->
<tr>
<td colspan="4">{links}</td>
</tr>
</table>
and here is the javascript function I use :
function deleteUser(id)
{
var answer = confirm("are you sure ?")
if (answer){
var userID = id;
var notice = $('contentDiv');
new Ajax.Request('adminpanel.php?action=deleteUser&userID=' +
userID, {
method: 'get',
onSuccess: function(transport) {
notice.update(transport.responseText);
},
onLoading: function(){
notice.update("loading ...");
}
});
var element = $('div'+id);
Effect.DropOut(element);
}
else{
alert("ups ...!")
}
}
function submitAddNewStaffForm()
{
var notice = $('contentDiv');
var notice = $('contentDiv');
var form = $('newStaffForm');
var staffName = $F('formName');
form.request();
form.request({
onLoading: notice.update("saving data .. ..."),
onComplete: function(transport){
notice.update("Form data saved...");
var newID = transport.responseText;
newRow = Builder.node('tr');
td1 = Builder.node('td',staffName);
td2 = Builder.node('td', [Builder.node('a', {href:
'#',onclick:"deleteUser('"+newID+"')"}, 'delete')]);
newRow.appendChild(td1);
newRow.appendChild(td2);
$('listStaff').appendChild(newRow);
}
})
}
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Limitless undying love
which shines around me like a million suns
It calls me on and on across the universe...."
Accross The Universe - The Beatles -
--------------------------------------------
Visit :
http://www.sabukhitam.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?hl=en
-~----------~----~----~----~------~----~------~--~---