How can i display loading/processing message inside DataTable?

前端 未结 4 1128
野性不改
野性不改 2021-01-21 03:08

In my application i am using datatables.net

var ticketHistoryDataTable = $(\'#ticketHistoryData\').DataTable({ 
        paging: false,
        data: [],
                 


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-21 04:04

    There is way the to display loading message on jQuery DataTable:

    $('#myTableId').DataTable({
            "language": {
                'loadingRecords': 'Processing...',
            },
    
      // 'processing': true,
    .
    .
    })
    

    On above code, // 'processing': true, is commented out, if not there will be two loading messages.

    You also can do this way:

    $('#myTableId').DataTable({
                "language": {
                    'loadingRecords': ' ',
                    'processing': 'Loading...'
                },
    

    You can also show the loading spinner:

    $('#myTableId').DataTable({
                    "language": {
                        "loadingRecords": "\n\
                                \n\
                            Processing ..."
                    },
    

提交回复
热议问题