DataTables

https://datatables.net/download/

这个页面,根据需要选择一个styling Framework,比如bootstrap4

step3选择Download这个tab,然后勾选concatenate,

最后下载的css和js文件开头会有一段类似

/*
 * This combined file was created by the DataTables downloader builder:
 *   https://datatables.net/download
 *
 * To rebuild or modify this file with the latest versions of the included
 * software please visit:
 *   https://datatables.net/download/#bs4/pdfmake-0.2.7/dt-1.13.6/b-2.4.2/b-html5-2.4.2/b-print-2.4.2
 *
 * Included libraries:
 *   pdfmake 0.2.7, DataTables 1.13.6, Buttons 2.4.2, HTML5 export 2.4.2, Print view 2.4.2
 */

 

https://github.com/DataTables/DataTables

DataTables is a table enhancing plug-in for the jQuery Javascript library, adding sorting, paging and filtering abilities to plain HTML tables with minimal effort. The stated goal of DataTables is:

To enhance the accessibility of data in HTML tables.

To meet this goal, DataTables is developed with two distinct groups of users in mind:

  • You the developers using DataTables. For developers DataTables provides a wide array of options for how data should be obtained, displayed and acted upon, along with an extensive API for accessing and manipulating the table.

  • End users. For those using the interface DataTables presents, actions to get the most from the information contained in tables, such as sorting and filtering, along with paging and scrolling of the data in table, are easy to use, intuitive and fast.

 

问题1 Cannot read property 'aDataSort' of undefined

https://stackoverflow.com/questions/28454203/jquery-datatables-cannot-read-property-adatasort-of-undefined

It's important that your THEAD not be empty in table.As dataTable requires you to specify the number of columns of the expected data . As per your data it should be

复制代码
<table id="datatable">
    <thead>
        <tr>
            <th>Subscriber ID</th>
            <th>Install Location</th>
            <th>Subscriber Name</th>
            <th>some data</th>
        </tr>
    </thead>
</table>
复制代码

 

问题2 隐藏掉search搜索框以及show entries

bLengthChange: false,
searching: false,

 

问题3  Cannot read property 'length' of undefined

https://datatables.net/manual/ajax

和ajax的返回值有关系

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(290)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2017-07-03 ControlDesigner
2015-07-03 CodeWars可以学习的
2015-07-03 Number of Rectangles in a Grid
2014-07-03 同步TreeView中父结点和子结点的状态[以及Treeview的bug]
点击右上角即可分享
微信分享提示