How to show empty data message in Datatables

前端 未结 7 1446
感动是毒
感动是毒 2020-12-07 20:04

Suppose i get empty data from server sometimes, i want to display No Data found message in DataTables?. How is this possible?

7条回答
  •  佛祖请我去吃肉
    2020-12-07 20:30

    I was finding same but lastly i found an answer. I hope this answer help you so much.

    when your array is empty then you can send empty array just like

    if(!empty($result))
            {
                echo json_encode($result);
            }
            else
            {
                echo json_encode(array('data'=>''));
            }
    

    Thank you

提交回复
热议问题