簡體   English   中英

在已點燃的數據表中添加操作

[英]add action in ignited datatables

我正在使用Ignited Datatables查看活動用戶。 我現在想要的是有一個“操作”列,可以禁用用戶。 這是我的代碼。

視圖:

<script type="text/javascript">
$(document).ready(function() {
    $('#users_table').dataTable({
        "sScrollX": "100%",
        "sScrollXInner": "100%",
        "sPaginationType": "full_numbers",
        "bProcessing": true,
        "bServerSide": true,
        "bJQueryUI": true,
        "bDeferRender": true,
        "sAjaxSource": "<?php echo base_url(); ?>/users/get_active_users",
        "sServerMethod": "POST",
        "aoColumnDefs": [{
            'bSortable': false,
            'aTargets': [7]
        }
        ]
    });
});
</script>
<thead>
  <tr>
     <th class="width70 text-center">Username</th>
     <th class="text-center">Full Name</th>
     <th class="text-center">Office</th>
     <th class="text-center">Position</th>
     <th class="text-center">Email</th>
     <th class="width60 text-center">Privilege</th>
     <th class="width160 text-center">Date Registered</th>
     <th class="width60 text-center">Actions</th>
  </tr>
</thead>
<tbody>
  <tr>
     <td colspan="7" class="dataTables_empty">Loading data from server</td>
  </tr>
</tbody>

使用點火的數據表,您需要在數據表中添加操作列,例如

$this->datatables->add_column('action', '<a href="user/disable/$1">Disable User</a>', id);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM