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 8426463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:32:22+00:00 2026-06-10T04:32:22+00:00

I am using DataTables plugin for jQuery for drawing table on my web app.

  • 0

I am using DataTables plugin for jQuery for drawing table on my web app. Everything is working correctly. But one of the option is to press a details button to open an info window which will have additional values. Now that part is working correctly but my table is defined with classes so I can change language dynamically when user changes language using menu.

The only thing that I am getting is in English, as I declared it at the start.

My predefined table:

function fnFormatDetails ( nTr )
{
    var aData = oTable.fnGetData( nTr );
    var sOut = '<table cellpadding="5" cellspacing="0" border="0" style="background-color:whitesmoke; padding-left:10%; padding-right:10%; width:100%">';
    sOut += '<tr><td style="text-align:left"><span class="id_prog">ID Program : '+aData[0]+'</span></td><td style="text-align:left"><span class="id_in_perc">Increment : '+aData[3]+'</span></td></tr>';
    sOut += '<tr><td style="text-align:left"><span class="id_var">Machine position : '+aData[1]+'</span></td><td style="text-align:left"><span class="id_tot_in_var">Total inc : '+aData[4]+'</span></td></tr>';
    sOut += '<tr><td style="text-align:left"><span class="id_dti_var">DTI : '+aData[2]+'</span></td></tr>';
    sOut += '</table>';

    return sOut;
}

When I change the language and my javascript is changing each value through the class name, nothing happens, but for the rest of my code this works fine but for this predefined table doesn’t. Any idea?

EDIT

This is a event listener:

$('#jphit tbody td img').live( 'click', function () {
        var nTr = $(this).parents('tr')[0];
        if ( oTable.fnIsOpen(nTr) )
        {
            /* This row is already open - close it */
            this.src = "images/plus-icon.png";
            oTable.fnClose( nTr );
        }
        else
        {
            /* Open this row */
            this.src = "images/minus-icon.png";
            oTable.fnOpen( nTr, fnFormatDetails(nTr), 'details' );
        }
} );

So when buttons is clicked I call fnFormatDetails() function but then its drawn only as it is set. So when I dynamically change the value of that table nothing is changing.

Do you need some more details?

  • 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-10T04:32:24+00:00Added an answer on June 10, 2026 at 4:32 am

    If i understand correctly, you try to dynamically change the contents of the table that is always on the page.
    I dont know why you would put that in your javascript but as you’re using jQuery i suggest a different approach.

    This would be in your html file.

    <table id="myTable">
        <tr>
            <td><span id="id1"><!-- content will load here --></span></td>
            <td><span id="id2"><!-- content will load here --></span></td>
        </tr>
    </table>
    

    I would use id instead of class because those values are unique.

    And the javascript to replace the contents of the html tags.

    function fnFormatDetails ( nTr ) {
        var aData = oTable.fnGetData( nTr );
        $("#id1").html("My data here " + aData[0]);
        $("#id2").html("My data here " + aData[1]);
        ...
    }
    

    This will replace the html content of the tag with the specified id with the content you specify as attribute.

    I hope that helps you out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the DataTables plugin for jQuery and need to get one of
I am using the jquery plugin DataTables for table sorting and manipulation. In a
I'm using the jQuery DataTables plugin, which is working really great so far. However
I'm using the dataTables jQuery plugin (which is totally awesome), but I'm having trouble
I'm currently working on a project using javascript and python with Jquery Datatables plugin
I am using the JQuery DataTables plugin for displaying large sets of data. One
I am using the jQuery DataTables plugin. I would like to move the search
I am using the jQuery DataTables plugin to do filtering on a set of
I have started using the DataTables plugin (v1.6.2) for jQuery (v1.4.2), and I would
I am using the jquery plugin datatables and am trying to take advantage of

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.