I am using the DataTables plugin for jQuery to draw a table in my web application. Everything is working correctly. But one of the options is to click the details button to open an information window that will have additional values. Now this part works correctly, but my table is defined by classes, so I can dynamically change the language when the user changes the language using the menu.
The only thing I get is in English, as I announced it from the very beginning.
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 changes every value through the class name, nothing happens, but for the rest of my code this works fine, but for this predefined table this is not the case. Any idea?
EDIT
This is an event listener:
$('#jphit tbody td img').live( 'click', function () {
var nTr = $(this).parents('tr')[0];
if ( oTable.fnIsOpen(nTr) )
{
this.src = "images/plus-icon.png";
oTable.fnClose( nTr );
}
else
{
this.src = "images/minus-icon.png";
oTable.fnOpen( nTr, fnFormatDetails(nTr), 'details' );
}
} );
, fnFormatDetails(), . , , .
?