zoukankan      html  css  js  c++  java
  • DataTable列渲染

      /* Init DataTables */
                oTable = $('#editable').dataTable({
                    "bProcessing": true,
                    "bServerSide": true,
                    "bSort": false, //排序功能关闭
                    "sAjaxSource": "@Url.Action("GetPsychiatrists")",
                    "iDisplayLength": "30",
                    "columnDefs": [
                        {
                            "targets": [0],
                            "data": "Id",
                            "visible": false,
                            "searchable": false
                        },
                        {
                            "targets": [1],
                            "data": "Name",
                        },
                        {
                            "targets": [2],
                            "data": "Lb"
                        },
                        {
                            "targets": [3],
                            "data": "problemType"
                        },
                        {
                            "targets": [4],
                            "data": "Resume"
                        },
                        {
                            "targets": [5],
                            "data": "Id",
                            "sWidth":"120px",
                            "render": function (data, type, full, meta)
                            {
                                return '<a  href= @Url.Action("PsyAppTime", "PsychiatristAppointmentTime")/'+data+'>管理预约时间</a>';
                            
                            }
                          
                        }
                        
                    
                    ]
                });
    $(document).ready(function () {
                dt = $('#editTable').dataTable({
                    "bProcessing": true,
                    "bServerSide": true,
                    "bSort": false,
                    "sAjaxSource": "xxxx",//这是要请求json数据的url
                    "oLanguage": {
                        "sLengthMenu": "每页显示 _MENU_ 条记录",
                        "sZeroRecords": "对不起,查询不到任何相关数据",
                        "sInfo": "当前显示 _START_ 到 _END_ 条,共 _TOTAL_ 条记录",
                        "sInfoEmtpy": "找不到相关数据",
                        //"sInfoFiltered": "数据表中共为 _MAX_ 条记录",  
                        "sProcessing": "正在加载中...",
                        "sSearch": "搜索",
                        "sInfoEmpty": "显示 0 至 0 共 0 项",
    "oPaginate": { "sFirst": "第一页", "sPrevious": "上一页 ", "sNext": "下一页 ", "sLast": "末页 " }
                    },
                    "aoColumns": [
                        { "mData": "teacher_id", "sClass": "center" },
                        { "mData": "teacher_name", "sClass": "center" },
                        { "mData": "organization_name", "sClass": "center" },
                        { "mData": "manageOrganization_name", "sClass": "center" },
                        { "mData": "teacher_phone", "sClass": "center" },
                        { "mData": "teacher_email", "sClass": "center" },
                        { "mData": "admin_id", "sClass": "center" }
    
                    ],
                    "aoColumnDefs": [
                     {
                         "aTargets": [6],
                         "mData": "操作",
                         "mRender": function (data, type, full) {
                             return '<a href="javascript:void(0);" class="delete" tag=' + data + '>删除</a>';
                         }
                     }
                    ],
                    "fnServerData": fnDataTablesPipeline
                });
  • 相关阅读:
    洛谷 1339 最短路
    洛谷 1330 封锁阳光大学 图论 二分图染色
    洛谷 1262 间谍网络 Tarjan 图论
    洛谷 1373 dp 小a和uim之大逃离 良心题解
    洛谷 1972 莫队
    洛谷 2158 数论 打表 欧拉函数
    洛谷 1414 数论 分解因数 水题
    蒟蒻的省选复习(不如说是noip普及组复习)————连载中
    关于筛法
    关于整数划分的几类问题
  • 原文地址:https://www.cnblogs.com/tianxiaziwei/p/5010218.html
Copyright © 2011-2022 走看看