Blogger Information
Blog 142
fans 5
comment 0
visits 130028
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
datatables 的js代码
php开发大牛
Original
721 people have browsed it

$('.table-sort').dataTable({
processing: true,
 serverSide: true,
 ajax: {
  "url":"{:U('Msg/index')}",
  "data":function(d){ //额外传递的参数
   d.mintime = $('#logmin').val();
   d.maxtime = $('#logmax').val();
  }
 },
 bStateSave: true,//状态保存
 aLengthMenu : [20, 30, 50, 100, 150],
 bProcessing : true,
 bAutoWidth: false,
 bFilter : true, //是否启动过滤、搜索功能
 bInfo : true, //是否显示页脚信息,DataTables插件左下角显示记录数
 createdRow: function ( row, data, index ) {
  $(row).addClass('text-c');
  $('#count').html(data.recordsFiltered);
 },
 aoColumns: [
  {
   "sClass": "text-center",
   "data": "id",
   "render": function (data, type, full, meta) {
    return '<input type="checkbox" name="select" value="' + data + '" />';
   },
   "bSortable": false
  },
  { "mData": "id" },
  { "mData": "fromnickname"},
  { "mData": "content" },
  { "mData": "msgtype" },
  { "mData": "time"},
  {
   "sClass": "text-center",
   "data": "id",
   "render": function (data, type, full, meta) {
    html = '<a title="查看" href="javascript:;" rel="external nofollow" rel="external nofollow" onclick="show(`查看`,`__URL__/show/id/'+ data + '`,``,`610`)" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">查看</i></a>';
    html += '<a style="text-decoration:none" class="ml-5" onClick="signDel(this,'+ data +')" href="javascript:;" rel="external nofollow" rel="external nofollow" title="删除"><i class="Hui-iconfont"></i>删除</a>';
    return html;
   },
   "bSortable": false
  }
 ]
});

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post