Display Loading Message

Display Loading Message

OrangeJuiceOrangeJuice Posts: 4Questions: 2Answers: 0
edited November 2015 in Free community support

Hi
I'm attempting to display a default loading message but unable to do so. The code loads records using Ajax. My code is as:

//In loop.

$('#myDash').dataTable().fnAddData( [ oProj,oTitle ] );

//Later code

$(document).ready(function() {
    $('#myDash').dataTable( {    
    paging: false,
    searching: false,
     "ajax": "json.txt",
     
  "language": {

     "loadingRecords": "Please wait - loading..."
        }
    } );
    
 } );

Now the loading message show but error alerted, 'Datatable warning:table id = Please see http://datatables.net/tn/7'
The Network Analysis show a 404 error but have no idea on how to fix. Its something to do with the json.txt ?
Is there another way to show Loading message?
Thanks

Answers

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    It looks like it basically cant see json.txt, you should really use the absolute path

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    And format your code, please..

  • OrangeJuiceOrangeJuice Posts: 4Questions: 2Answers: 0

    Hi

    I used the following example, but there is no mention what json.txt is. I haven't installed this file anywhere, what needs to be done ? is it needed?
    https://datatables.net/reference/option/language.loadingRecords

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Lol.. json.txt is supposed to be the Path/URL to the JSON source... Read ajax.

    I guess its not labeled that the ajax value in the example is the url to the JSON, because thats about as obvious as it can possibly get.

  • OrangeJuiceOrangeJuice Posts: 4Questions: 2Answers: 0

    Hi
    I don't think I need the json.txt section which I added for the loading message alone.

    I am loading the array from a loop in an earlier process :

    $('#myDash').dataTable().fnAddData( [ oProj,oTitle ] );
    

    All I want to do is show a loading message, can I do this without the json.txt?

This discussion has been closed.