Show the text "Loading"

Show the text "Loading"

INTONEINTONE Posts: 153Questions: 58Answers: 6
edited April 2015 in DataTables 1.10

I notice that when I am looking around on the demos provided I generally see a "loading" text which is showed until the datatable is populated but that is not seen in my datatables. Also I am not seeing any special code from the examples that implement the "loading" feature. Therefore my question is how is this done?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited April 2015

    The language.loadingRecords option is used to display loading text for Ajax sourced tables.

    Allan

    edited to point to correct parameter!

  • INTONEINTONE Posts: 153Questions: 58Answers: 6
    edited April 2015

    ok Alan. Thanks for your quick response. However I am using server side processing on all of my tables. Is there a way to accomplish this with server side processing? I see one coveat :

    "Note that this parameter is not used when loading data by server-side processing, just Ajax sourced data with client-side processing."

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited April 2015

    If you are using server-side processing add a tr element in the table's body that is simply something like <tr><td colspan="4">Loading...</td></tr>. DataTables will ignore it in server-side processing and then replace it when the data has been loaded.

    Allan

  • INTONEINTONE Posts: 153Questions: 58Answers: 6

    Thanks. I think that should be colspan in stead of rowspan.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Doh - it certainly should. Corrected :-)

    Allan

  • INTONEINTONE Posts: 153Questions: 58Answers: 6

    Or i could just use the processing: true - native is better.

This discussion has been closed.