datatable not working i use CI, Boostrap, etc ? help me please

datatable not working i use CI, Boostrap, etc ? help me please

M@XM@X Posts: 2Questions: 2Answers: 0
edited October 2016 in Free community support
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>asset/css/jquery.dataTables.css">

<div class="row col-md-12">
  <div class="panel panel-info">
    <div class="panel-heading">Data Trainee
      <div class="tombol-kanan">
        <a class="btn btn-success btn-sm tombol-kanan" href="#" onclick="return m_trainee_e(0);"><i class="glyphicon glyphicon-plus"></i> &nbsp;&nbsp;Tambah</a>
      </div>
    </div>
    <div class="panel-body">


      <table id="example" class="table table-bordered">
        <thead>
          <tr>
            <th width="5%">No</th>
            <th width="25%">Nama</th>
            <th width="15%"> ID Employee</th>
            <th width="20%">Division</th>
            <th width="35%">Aksi</th>
          </tr>
        </thead>

        <tbody>
          <?php 
            if (!empty($data)) {
              $no = 1;
              foreach ($data as $d) {
                echo '<tr>
                      <td class="ctr">'.$no.'</td>
                      <td>'.$d->nama.'</td>
                      <td>'.$d->id_employee.'</td>
                      <td>'.$d->division.'</td>
                      <td class="ctr">
                        <div class="btn-group">
                          <a href="#" onclick="return m_trainee_e('.$d->id.');" class="btn btn-info btn-xs"><i class="glyphicon glyphicon-pencil" style="margin-left: 0px; color: #fff"></i> &nbsp;&nbsp;Edit</a>
                          <a href="#" onclick="return m_trainee_h('.$d->id.');" class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-remove" style="margin-left: 0px; color: #fff"></i> &nbsp;&nbsp;Hapus</a>
                          <a href="#" onclick="return m_trainee_training('.$d->id.');" class="btn btn-success btn-xs"><i class="glyphicon glyphicon-th-list" style="margin-left: 0px; color: #fff"></i> &nbsp;&nbsp;Training Subject</a>
                          ';
                if ($d->ada == "0") {
                  echo '        <a href="#" onclick="return m_trainee_u('.$d->id.');" class="btn btn-info btn-xs"><i class="glyphicon glyphicon-user" style="margin-left: 0px; color: #fff"></i> &nbsp;&nbsp;Aktifkan User</a>';
                } 
                  
                
                echo '</div>
                      </td>
                      </tr>
                      ';
              $no++;
              }
            }
          ?>
        </tbody>
       </table>
          <script type="text/javascript" src="<?php echo base_url(); ?>asset/js/jquery.min.js"></script>
          <script type="text/javascript" src="<?php echo base_url(); ?>asset/js/jquery.dataTables.min.js"></script>
          <script>
          <script>
            $(document).ready(function() {
            $('#example').dataTable({
                responsive: true
            });
        });
    </script>
          </script>
     </div>
    </div>
  </div>
</div>
                    




<div class="modal fade" id="m_trainee" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 id="myModalLabel">Data Trainee</h4>
      </div>
      <div class="modal-body">
          <form name="f_trainee" id="f_trainee" onsubmit="return m_trainee_s();">
            <input type="hidden" name="id" id="id" value="0">
              <table class="table table-form">
                <tr><td style="width: 25%">Nama</td><td style="width: 75%"><input type="text" class="form-control" name="nama" id="nama" required></td></tr>
                <tr><td style="width: 25%">ID Employee</td><td style="width: 75%"><input type="text" class="form-control" name="id_employee" id="id_employee" required></td></tr>
                <tr><td style="width: 25%">Department</td><td style="width: 75%"><input type="text" class="form-control" name="division" id="division" required></td></tr>
              </table>
      </div>
      <div class="modal-footer">
        <button class="btn btn-primary">Simpan</button>
        <button class="btn" data-dismiss="modal" aria-hidden="true">Tutup</button>
      </div>
        </form>
    </div>
  </div>
</div>

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.

    Information on how to create a test page, if you can't provide a link to your own page can be found here.

    Thanks,
    Allan

This discussion has been closed.