jquery DataTable--front and back dynamic paging

巴扎黑
Release: 2017-08-05 16:36:58
Original
1790 people have browsed it

Organize the documents, search out a jquery DataTable to implement front-end and back-end dynamic paging, and organize and streamline it a little for sharing.

html code:


     测试页面      
  

Name Cellphone Position Company Salary

Copy after login

PHP code:


name=="sEcho"){ $sEcho=$value->value; } if($value->name=="iDisplayStart"){ $iDisplayStart=$value->value; } if($value->name=="iDisplayLength"){ $iDisplayLength=$value->value; } } $Array = Array(); //此处生成50条数据,模仿数据库数据 for ($i = 1; $i < 51; $i++) { $d = array($i,$i,$i,$i,$i); Array_push($Array, $d); } $json_data = array ('sEcho'=>$sEcho,'iTotalRecords'=>50,'iTotalDisplayRecords'=>50,'aaData'=>array_slice($Array,$iDisplayStart,$iDisplayLength)); //按照datatable的当前页和每页长度返回json数据 $obj=json_encode($json_data); echo $obj; ?>
Copy after login

Rendering:

jquery DataTable--front and back dynamic paging

jquery DataTable--front and back dynamic paging

The above is the detailed content of jquery DataTable--front and back dynamic paging. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!