window.myboolean = false ;
<tr onclick = "window.location.href = '<%= url_for :controller => 'manage', :id => whymail.id, :type => "whymail", :action => 'show' %>' " style = "cursor:pointer:" > <td> My Content </td> </tr>
While clickable rows is a neat little trick, what happens when you want to put a button or a checkbox in your table row to really get a gmail feel? When you click your button or your select box, you’re also clicking in the table row, so you automatically tell the browser to redirect to a different url. Make Sense?
<tr onclick = "window.location.href = '<%= url_for manage_spam_url(id) %>' " style = "cursor:pointer:" > <td> My Content </td> <td> <%= button_to_remote "Delete", :url => spam_survey_url(:id => whymail.id) , :update => "partial_update" %></td> </tr>
<tr onclick = "window.location.href = window.myboolean ? '#' : '<%= url_for manage_spam_url(id) %>' " style = "cursor:pointer:" >
and we can set our flag in the header like this:
Then in our button we can set the flag to true when it gets pressed:
<%= button_to_remote "Delete", :url => spam_survey_url(:id => whymail.id) , :update => "partial_update", :loading => "window.myboolean = true;", :complete =>"window.myboolean=false;" %>