码迷,mamicode.com
首页 > Web开发 > 详细

jquery datatable

时间:2015-08-14 13:24:21      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:

//初始化 加载数据
 /* Init DataTables */
        var oTable = $(#editable).dataTable({
            bLengthChange: false,
            pageLength: 10,
            bPaginate: true,
            searching: false,
            ordering: false,
            processing: true,
            bServerSide: true,
            ajax: "/System/MGFuncInfo",
            columns: [
               { "data": "FNumber" },
               { "data": "FName" },
               { "data": "FDescription" },
               { "data": "FUrl" },
               { "data": "FuncID" }
            ],
            columnDefs: [{
                "targets": [4],
                "data": "FuncID",
                "render": function (data, type, full) {
                    return "<button onclick=editinfo(‘" + full.FuncID + "‘); class=‘btn btn-primary ‘>編輯</button> <button onclick=deleteinfo(‘" + full.FuncID + "‘); class=‘btn btn-primary ‘>刪除</button>";
                }
            }]
        });

 

// 新增数据
 oTable.fnAddData(data);

//删除数据
oTable.fnDeleteRow(RowIndex);

//获取总行数
oTable.fnSettings().fnRecordsTotal();

//获取某行数据JSON
oTable.dataTable().fnGetData(RowIndex);

//获取DataTable 所有数据的JSON数组
oTable.api(true).rows().nodes().toArray();

 

jquery datatable

标签:

原文地址:http://www.cnblogs.com/CoreXin/p/4729399.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!