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

  • Home
  • SEARCH
  • 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 6349635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:39:17+00:00 2026-05-24T21:39:17+00:00

I have a jQuery Datatable with 3 headers. One header contains two radio buttons,

  • 0

I have a jQuery Datatable with 3 headers. One header contains two radio buttons, another header contains a select box. By default, one of the options is checked.

When I use the search function in the Datatable to search for specific records, it does not display which radio button was checked. I inspected the DOM after I used the datatable search, and the input element still contains the CHECKED attribute. The select box is not affected. It still retains the value of the select box.

Also, IE behaves fine. O_o FF and Chrome are not recognizing the checked value.

I tried a $(selector).datatable().fnDraw();… no dice.

How do I get the datatable to recognize the checked attribute after, or during, the search? Has anyone experienced something similar?

Any help is appreciated. Thanks.

Edit: After further investigation, it looks like the fnDraw is clearing the value of the radio button.

Code

Initialize datatable (Javascript)

$.get('store_handler.ashx', { cmd: '9', pubId: pubId, sub: sub }, function(o) {
    $("#researchTableDiv").html(o.datatableContent);

    $('#ResearchTable').dataTable({
        "bJQueryUI": true,
        "bPaginate": false,
        "sScrollY": "450px",
        "bSort": false
    });

    if (o.radioCheck == "single")
        $('#radioSingle').attr("checked", "checked");
    else
        $('#radioSub').attr("checked", "checked");

}, "json");

HTML of datatable headers (C# .Net)

    htmlString.Append("<thead>");
    htmlString.Append("<tr>");
    htmlString.Append("<th valign=\"middle\" style=\"width: 200px; text-align: left;valign:top;border-right:0px;padding-bottom:0px\" class=\"header\">Filter:&nbsp;");
    htmlString.Append("<select name=\"nonSort2\" style=\"height:20px;padding:0px;margin-top:-0px;font-size:11px\">");
    htmlString.Append("<option value=\"AKLPH\">All</option>");
    htmlString.Append("<option value=\"-\">---------------</option>");
    htmlString.Append("<option value=\"AK\">Alaska</option>");
    htmlString.Append("<option value=\"AL\">Etc...</option>");
    htmlString.Append("</select>");
    htmlString.Append("</th>");
    htmlString.Append("<th align=\"left\" class=\"header\" >");
    if (sub == "0")
    {
        htmlString.Append("<input type=\"radio\" value=\"0\" name=\"rdoSubscription\" id=\"radioSingle\" checked=\"CHECKED\" style=\"margin-left:1px\"/>Single Report");
        htmlString.Append("<input type=\"radio\" value=\"1\" name=\"rdoSubscription\" id=\"radioSub\" onclick=\"getPubDetails('" + pubId + "','1');\" style=\"margin-left:1px\"/>Subscription");
        jOut.Put("radioCheck", "single");
    }
    else
    {
        htmlString.Append("<input type=\"radio\" value=\"0\" name=\"rdoSubscription\" id=\"radioSingle\" onclick=\"getPubDetails('" + pubId + "','0');\" style=\"margin-left:1px\"/>Single Report");
        htmlString.Append("<input type=\"radio\" value=\"1\" name=\"rdoSubscription\" id=\"radioSub\" checked=\"CHECKED\" style=\"margin-left:1px\"/>Subscription");
        jOut.Put("radioCheck", "sub");
    }
    htmlString.Append("</th>");
    htmlString.Append("<th class=\"header\" align=\"center\">Action</th>");
    htmlString.Append("</tr>");
    htmlString.Append("</thead>");
  • 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-05-24T21:39:18+00:00Added an answer on May 24, 2026 at 9:39 pm

    Try setting the radio button after the draw event:

    $.get('store_handler.ashx', { cmd: '9', pubId: pubId, sub: sub }, function(o) {
    $("#researchTableDiv").html(o.datatableContent);
    
    $('#ResearchTable').dataTable({
        "bJQueryUI": true,
        "bPaginate": false,
        "sScrollY": "450px",
        "bSort": false,
        "fnDrawCallback": function() {
          if (o.radioCheck == "single")
            $('#radioSingle').attr("checked", "checked");
          else
            $('#radioSub').attr("checked", "checked");
          }
       }
    });
    
    
    }, "json");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a column with buttons in a table I'm using jQuery datatable plugin.
I am using the jquery datatable plugin. I have the following code that sets
I have a jQuery DataTable configured for server-side processing against an ASP.NET MVC server.
I have a jquery datatable using the following code: // Test list table $('#dashboard_testlist_table').dataTable({
I have a jQuery datatable(outlined in red), but what happens is that the table
i've got a jquery datatable (http://www.datatables.net/), and one column has a largish text field.
If I don't have a reference to an existing jQuery datatable, how can i
I have a large amount of data I wish to use with Jquery DataTable
I have a local JSON dataset. I want to use jquery datatable plugin to
Say I have jquery code like this: html += '<div class=index>' + item.index +

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.