1.8.0 sLoadingRecords not working [solved]

1.8.0 sLoadingRecords not working [solved]

max4evermax4ever Posts: 45Questions: 0Answers: 0
edited June 2011 in General
Hello i'm using dataTables 1.8.0 with jquery 1.6.1 and latest jquery-ui

the http://www.datatables.net/usage/i18n#oLanguage.sLoadingRecords property doesn't seem to do anything, i tried

[code]
"oLanguage": {
"sLoadingRecords": "Please wait - loading..."
},
[/code]
and then i tried
[code]
"oLanguage": {
"sLoadingRecords": "Please wait - loading...",

"sUrl": "/lang/dataTables-<?=Zend_Registry::get('Zend_Locale')?>.txt"
},
[/code]

and also i tried putting it in my language file
[code]
"oLanguage": {
"sUrl": "/lang/dataTables-<?=Zend_Registry::get('Zend_Locale')?>.txt"
},
[/code]

i am using an Ajax source like this
[code]
"sAjaxSource": "/"+controller_name+"/ajax/",
[/code]

and i put a sleep 5seconds on the server, but the messagge is not shown

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Can you link us to your example please? I've been using this property quite a lot recently and I've not had a problem with it - but it would be good to get the the bottom of what is happening.

    Allan
  • max4evermax4ever Posts: 45Questions: 0Answers: 0
    i am sorry but i can not provide a link, i can post the source code
    [code]
    oTable = $('#visualizzazione').dataTable(
    {
    "bDeferRender": true,
    "oLanguage": { "sUrl": "/lang/dataTables-it_IT.txt"},
    "aoColumns": [
    { "sName": "ragsoc", "sWidth": "20%"},
    { "sName": "piva", "sWidth": "20%"},
    { "sName": "indirizzo", "sWidth": "20%"},
    { "sName": "citta", "sWidth": "20%"},
    { "sName": "id", "sWidth": "20%", "bSortable": false, "bSearchable": false } ],
    bAutoWidth:false,
    "aLengthMenu": [[5, 10, 25, 50, 100, -1], [5, 10, 25, 50, 100, "Tutti"]],
    "iDisplayLength" : 10,
    "sPaginationType": "full_numbers",
    "bJQueryUI": true,
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "/"+controller_name+"/ajax/",
    "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
    ....
    return nRow;
    },
    "fnInitComplete": function()
    {
    this.fnSetFilteringDelay();//this is callback function
    }
    });


    /* Add a click handler to the rows - this could be used as a callback */
    $("#visualizzazione tbody tr").live('click', function(event) {
    if ($(event.target).is('tr') || $(event.target).is('td'))//non ho fatto click su link
    {
    $(this).addClass('row_selected');

    var link = $(this).find('td').filter(':last').find('a:eq(0)').attr('href');
    window.location.href = link;
    }
    });


    [/code]
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Can you show me the contents of your "/lang/dataTables-it_IT.txt" file as well please?

    Allan
  • max4evermax4ever Posts: 45Questions: 0Answers: 0
    [code]
    {
    "sLoadingRecords": "Attendere per favore - stiamo caricando i dati...",
    "sProcessing": "Caricamento...",
    "sLengthMenu": "Visualizza _MENU_ elementi",
    "sZeroRecords": "La ricerca non ha portato alcun risultato.",
    "sInfo": "Vista da _START_ a _END_ di _TOTAL_ elementi",
    "sInfoEmpty": "Vista da 0 a 0 di 0 elementi",
    "sInfoFiltered": "(filtrati da _MAX_ elementi totali)",
    "sInfoPostFix": "",
    "sSearch": "Cerca:",
    "sUrl": "",
    "oPaginate": {
    "sFirst": "Inizio",
    "sPrevious": "Precedente",
    "sNext": "Successivo",
    "sLast": "Fine"
    }
    }
    [/code]
  • max4evermax4ever Posts: 45Questions: 0Answers: 0
    maybe it's the table ?

    [code]



    Ragione Sociale
    Partita IVA

    Indirizzo
    Città
    Operazioni






    Stiamo caricando i dati…









    [/code]
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Doh - sorry I missed the fact that you are using server-side processing! "sLoadingRecords" is only used when you use Ajax sourced data with client-side processing - not with server-side processing! When using server-side processing the message that you have in the table currently "Stiamo caricando i dati…" will be left until it is replaced with whatever data gets loaded into the table.

    Allan
  • max4evermax4ever Posts: 45Questions: 0Answers: 0
    ah so that's the problem, thank you
This discussion has been closed.