Draw when downloading sLanguage

Draw when downloading sLanguage

ColorAntColorAnt Posts: 5Questions: 0Answers: 0
edited February 2014 in Bug reports
Is it a bug?

Create dT-object, declare oLanguage.sUrl.
Invoke redraw on dT-object
[code]
var table = $("#myId").dataTable({
"oLanguage":{
"sUrl":'/resources/js/datatable-language-ru_RU_alternative.js'
},
});
table.fnDraw();
[/code]
$("#myId") already mark as dT-object, but load oLanguage is anisochronous, and we have
[code]
var sZero = oLang.sZeroRecords;
[/code]
equal "undefined"
and exeption in _fnInfoMacros in
[code]
return str.
replace(/_START_/g, sStart).
replace(/_END_/g, sEnd).
replace(/_TOTAL_/g, sTotal).
replace(/_MAX_/g, sMax);
[/code]

I offer use flag, that indicate what loading are not completely, and cancelled redraw.

Replies

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    It probably shouldn't throw an error, but it won't do very much even if it doesn't throw an error, since, as you say, the Ajax load is async. Use fnInitComplete to know when DataTables has completed its initialisation.

    Allan
  • ColorAntColorAnt Posts: 5Questions: 0Answers: 0
    Yes, probably you right, but I not own or creator this code, it write people with different competension :)
    And I suggested what additional test not be over, and reliability are increase.
This discussion has been closed.