jQuery DataTables - Slow initiation, “Normal” html table shown in the beginning

后端 未结 10 1302
旧时难觅i
旧时难觅i 2021-02-03 22:01

I\'m using jQuery DataTable plugin, but I got a concern where the scripts loading seems to take some time, so my web page is always displaying the ordinary html table first, and

10条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-03 22:39

    • The following is a node.js handlebars example. However, you can render the data using whatever web front-end framework you are using.
    • If you're using bootstrap you can hide the table initially using the hidden class or alternatively hide the elements manually.
    • Then in the initComplete callback you can then use jQuery to remove the hidden class to display the table only once it has loaded completely.

    
    
    
    
    
      {{#each devices}}
        
      {{/each}}
    
    
    

    For example:

提交回复
热议问题