How can i display loading/processing message inside DataTable?

前端 未结 4 1125
野性不改
野性不改 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

    When loading data from an Ajax source, you can use the following two events to handle the "Loading..." and "Done" states.

    ... data table code ...

        }).on('preXhr.dt', function ( e, settings, data ) {
    
            $(".thealert").html("Loading");
    
        }).on( 'draw.dt', function () {
    
            $(".thealert").html("Done");
    
        }); 
    

    I hope that helps.

提交回复
热议问题