Hi,<br />
<br />
When I using an external translation file <a href="http://datatables.net/plug-ins/i18n" target="_blank" rel="nofollow">http://datatables.net/plug-ins/i18n</a (the french translation case)<br />
<code class='multiline brush: js;'>
$('#tableTicketsProcheSla').dataTable({
"oLanguage": {
"sUrl":"js/Frameworks/jquery/internationalisation/datatable_french.txt"
}, ... });
</code>
I obtain the following message : <br />
TypeError : str is undefined
<br />
at jquery.datatable.js at line 2567.<br />
When I search the line in case of that mistake, I found the sOut as undefined at line 1509 of the datatable file, the variable sZero is initialized
oLang.sZeroRecords
at line 1499.<br />
I solve the problem by added the following code <br />
<code class='multiline brush: js;'>
else if ( sZero === undefined )
{
sZero = "";
}
</code>
at line 1509.<br />
<br />
An other solution is to include the content of the translation directly in the js file I wrote like this :<br />
<code class='multiline brush: js;'>
$('#tableTicketsProcheSla').dataTable({
"oLanguage": {
...the translation copy...
}, ... });
</code>
<br />
This error appear when I apply a filter on column (the last line).<br />
<br />
Maybe I don't use datatable correctly, if you have any idea why I obtain the undefined value whitout modification of datatable framework.<br />
<br />
My code :<br />
<code class='multiline brush: js;'>
function sortTableSla( userName )
{
var tableProcheSla = $('#tableTicketsProcheSla').dataTable({
"oLanguage": {
"sUrl":"js/Frameworks/jquery/internationalisation/datatable_french.txt"
},
"aoColumnDefs": [
{ "sWidth": "50px" , "aTargets": [ 0 ] },
{ "sWidth": "350px", "aTargets": [ 1 ] },
{ "sWidth": "100px", "aTargets": [ 3 ] },
{ "sWidth": "100px", "aTargets": [ 4 ] },
{ "sWidth": "100px", "aTargets": [ 5 ] },
{ "sWidth": "170px", "aTargets": [ 6 ] }
],
"bStateSave": true,
"iDisplayLength": 10,
"bLengthChange": false,
"bAutoWidth": false,
"bDestroy": true,
"aaSorting":[ [4,'asc'] ]
}).columnFilter({
sPlaceHolder: "head:after",
aoColumns: [
{ type: "text" },
{ type: "text" },
{ type: "select" },
{ type: "date-range" },
{ type: "date-range" },
{ type: "select" },
{ type: "select" }
]
});
var found = false;
$(&#039;#tableTicketsProcheSla&#039;).find(&quot;select&quot;).each(function( index ){
try{
$(this).find(&quot;option&quot;).filter(function(){
if( $(this).text() == userName ) found = true;
return $(this).text() == userName;
}).prop(&#039;selected&#039;, true);
}catch (e) {
console.log(e);
}
});
//
if( !found )
{
var divParent = $("#tableTicketsProcheSla").parent();
var newDiv = createDivForDataTable("tableTicketsProcheSla", userName, 2 );
divParent.append( newDiv );
}
tableProcheSla.fnFilter( userName, 2 );
}
</code>
<br />
Thanks for your help,<br />
Regards,<br />
Mathieu