博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Extjs 分页实例 后台php
阅读量:6259 次
发布时间:2019-06-22

本文共 7787 字,大约阅读时间需要 25 分钟。

前台js

Ext.onReady(function(){	var store = Ext.create('Ext.data.JsonStore',{		proxy: {			type: 'ajax',			url: 'role.php',			reader:{				type: 'json',				root:'systemLogs',				totalProperty: 'totalCount' //注意这里的拼写错误			}		},		pageSize: 5,		autoLoad: true,		fields: [	        {name: 'time',  type: 'date'},	        {name: 'username'},	        {name: 'type', type: 'string'},	        {name: 'ipAddress'},	        {name: 'content', type: 'string'}	    ] 	});			var my_grid = Ext.create('Ext.grid.Panel',{		xtype: 'grid',		store: store,		renderTo:Ext.getBody(),		columns: [ 			new Ext.grid.RowNumberer(),			{ text: '操作时间', sortable : true, dataIndex: 'time', width:200},			{ text: '操作账号', sortable : true, dataIndex: 'username'}, 			{ text: '操作类型',  sortable : true,dataIndex: 'type'},			{ text: 'IP地址', sortable : true, dataIndex: 'ipAddress', width:200}, 			{ text: '操作内容', sortable : true, dataIndex: 'content', width:400}		],			bbar: {			xtype: 'pagingtoolbar',			pageSize: 5,			store: store,			displayInfo: true		}	});	});

role.php

true,'totalCount'=>$count,'systemLogs'=>$data_out));?>

 data.json

{    "systemLogs": [        {            "content": "删除用户",            "endTime": "2014-12-11 17:01:04",            "id": "3",            "ipAddress": "192.168.0.1",            "startTime": "2014-12-11 17:01:04",            "time": "2014-12-11 17:01:04",            "type": 2,            "username": "李四"        },        {            "content": "删除用户",            "endTime": "2014-12-11 17:01:08",            "id": "4",            "ipAddress": "192.168.0.1",            "startTime": "2014-12-11 17:01:08",            "time": "2014-12-11 17:01:08",            "type": 2,            "username": "李四"        },        {            "content": "用户[admin]于[2015-01-09]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ace09a2014ace14acc50000",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-09 17:44:29",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-09]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ace09a2014ace14d1730001",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-09 17:44:38",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-13]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae12197014ae1226cb00000",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-13 10:32:17",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7dd2d014ae7e1e1ef0000",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 17:59:08",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7dd2d014ae7eb8e9e0001",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:09:42",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7dd2d014ae7ef64fb0002",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:13:53",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7dd2d014ae7f004190003",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:14:34",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7dd2d014ae7f310ad0004",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:17:54",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7dd2d014ae7f41be40005",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:19:02",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7f808014ae7fd09a80000",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:28:47",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7f808014ae7ff938f0001",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:31:34",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7f808014ae80445090002",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:36:41",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7f808014ae804704f0003",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:36:52",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7f808014ae805fbe10004",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:38:33",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7f808014ae80627e20005",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:38:45",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7f808014ae8075ce80006",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:40:04",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae7f808014ae8081f4d0007",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:40:54",            "type": 3,            "username": "admin"        },        {            "content": "用户[admin]于[2015-01-14]在[192.168.1.161]修改了登入密码",            "endTime": "",            "id": "402881214ae80915014ae80a41d00000",            "ipAddress": "192.168.1.161",            "startTime": "",            "time": "2015-01-14 18:43:13",            "type": 3,            "username": "admin"        }    ],    "totalCount": 20}

  

 

  

转载于:https://www.cnblogs.com/yll-sww/p/4363517.html

你可能感兴趣的文章
Android逆向之旅---反编译利器Apktool和Jadx源码分析以及错误纠正
查看>>
Android中下拉框spinner的两种用法
查看>>
Andrew Ng 的 Machine Learning 课程学习 (week2) Linear Regression
查看>>
Windows下安装MongoDB
查看>>
MyBatis在insert插入操作时返回主键ID的配置
查看>>
使用eclipse的todo标签管理任务
查看>>
iOS 开发自定义一个提示框
查看>>
CentOS6.5加域
查看>>
互联网+时代,移动互联网安全怎么自我防范呢?
查看>>
图片上传预览功能
查看>>
org.apache.log4j.Logger 详解
查看>>
Tiny Linux -- tce-load
查看>>
Android 中自定义控件和属性(attr.xml,declare-styleable,TypedArray)的方法和使用
查看>>
vue中get和post请求
查看>>
2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest A Email Aliases(模拟STL vector+map)
查看>>
Mr. Frog’s Game
查看>>
3.4可靠数据传输的原理
查看>>
多媒体通信-3-30-2018
查看>>
【Spring Boot&&Spring Cloud系列】Spring Boot中使用数据库之MySql
查看>>
【Spring Boot && Spring Cloud系列】那些Spring Boot中踩过的坑
查看>>