如何使用带有html和angularJs的数据表

时间:2017-03-24 10:38:03

标签: jquery angularjs datatables

我正在尝试在html和angularjs中使用jquery数据表。在这里,我试图编写代码,但当我搜索任何显示没有找到记录,即使我尝试排序数据,它也显示没有找到记录..即使有很多数据.. 这就是我写的......

<table class="table table-striped" datatable="ng" id="myTable">
          <thead>
            <tr>
              <th>Job Title</th>
              <th>Description</th>
              <th>No Of Positions</th>
              <th>Job Positions</th>
              <th>Job Time</th>
              <th>Experience</th>
              <th>Action</th>
            </tr>
          </thead>
          <tbody>
            <tr ng-repeat="pendingJobs in pending">
              <td>{{pendingJobs.id}}</td>
              <td>{{pendingJobs.job_title}}</td>
              <td>{{pendingJobs.descr}}</td>
              <td>{{pendingJobs.no_positions}}</td>
              <td>{{pendingJobs.job_position}}</td>
              <td>{{pendingJobs.job_time}}</td>
              <td>{{pendingJobs.experience}}</td>
              <td><a href="#" title="Approve">
                <i class="fa fa-check-square-o" aria-hidden="true" title="Approve" ng-click="markAsApprove(pendingJobs.id);"></i>
              </a>
              <a href="#">
                <i class="fa fa-times" aria-hidden="true" title="Edit"></i>
              </a>
              <a href="#">
                <i class="fa fa-exclamation-circle" aria-hidden="true" title="Delete"></i>
              </a></td>
              <td><a href="#">
                <i class="fa fa-eye" aria-hidden="true" title="View Detail"></i>
              </a>
              <a href="#">
                <i class="fa fa-pencil-square-o" aria-hidden="true" title="Edit"></i>
              </a>
              <a href="#">
                <i class="fa fa-trash-o" aria-hidden="true" title="Delete"></i>
              </a></td>
            </tr>
          </tbody>
        </table>

这是php json文件..

 <?php
//database settings
include "../inc/db.php";
$query="select * from jobs where status = 'pending'";
//$data = array();
$rs=mysqli_query($db,$query);

while ($row = mysqli_fetch_array($rs,MYSQL_ASSOC)) {
  $data[] = $row;
}

    print json_encode($data);
?>

0 个答案:

没有答案