Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8917297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:27:07+00:00 2026-06-15T05:27:07+00:00

Weird, intermittent problems are hard to solve without all the code, but here goes

  • 0

Weird, intermittent problems are hard to solve without all the code, but here goes (I’m getting desperate):

I have an HTML table that uses Datatables:

$('#DatagridTable').dataTable({ 
    'sPaginationType': 'full_numbers',
}); 

I have a jQuery click event for the table that sends the contents of the first cell in the clicked row to a form and then submits the form. Here’s the function:

//  On row click, go to single-view page
$('.c_grid_tr').click(function() {  
    var equipID = $(this).find('td:first').text();
    //  Fill hidden text box on form with value to post
    $('#singleRowID').val(equipID);
    //  Post form
    $('#formEquipment').submit();
});

The click function works fine until I use any of the navigation features of Datatables (go to another page, sort, change the number of records displayed). But after doing any of these, my click event only works sporadically, seemingly on random rows. I’ve looked a the HTML source, but the rows where the click event works and those where it doesn’t are identical. Here’s an example of two rows that are rendered in Firefox:

<tr class='c_grid_tr'>
    <td style='display:none;'>817</td>
    <td class='c_grid_td'>Ground Optic #1</td>
    <td class='c_grid_td'>Zeiss</td>
    <td class='c_grid_td'>950</td>
    <td class='c_grid_td'>DTY</td>
    <td class='c_grid_td'>Storage Facility</td>
    <td class='c_grid_td'>Y</td>
</tr><tr class='c_grid_tr'>
    <td style='display:none;'>818</td>
    <tdclass='c_grid_td'>Ground Optic #1</td>
    <td class='c_grid_td'>Zeiss</td>
    <td class='c_grid_td'>950</td>
    <td class='c_grid_td'>DTZ</td>
    <td class='c_grid_td'>Storage Facility</td>
    <td class='c_grid_td'>Y</td>
</tr>

The first row responds to the click event. The second one does not, and this problem occurs ONLY after I have sorted, changed pages, or changed the number of displayed records. I put an alert box in my click event, and that doesn’t fire, so I know that the click event isn’t even activated when I click the second row.

As always, thanks for any on-topic advice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:27:09+00:00Added an answer on June 15, 2026 at 5:27 am

    The problem is most likely that certain columns were included in the first load (when the click event was bound), but on subsequent loads you’re not reloading the whole page, just the table, so the event isn’t rebound to the new elements.

    You’re going to want to unbind and rebind the event on table draw, I think, i.e.:

    "fnDrawCallback": function (oSettings) {
        $('.c_grid_tr').unbind();
        //  On row click, go to single-view page
        $('.c_grid_tr').click(function() {  
            var equipID = $(this).find('td:first').text();
            //  Fill hidden text box on form with value to post
            $('#singleRowID').val(equipID);
            //  Post form
            $('#formEquipment').submit();
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Weird to describe but here goes. I have a table with several rows. One
Weird question but here goes... I have a webpage and i want to get
Pretty simple code but a weird situation... have a template with this snippet: {%
Weird question, but I'm not sure if it's anti-pattern or not. Say I have
Weird question but here it is. What are the programming concepts that were automated
Weird not sure if I have it correct but the output is weird: select
Weird issue here - I have identical what should be identical Python and Java
We have a weird intermittent problem with saving from Word 2007 to our SharePoint
another weird problem with the iPhone SDK here. I have a UITableView which contains
Hey weird question but I am writing some code and I want to clean

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.