game.php页面内容:
<?php
include_once ('admin_global.php');
$query=$db->findall("gamename");
$arr_game_list=array();
while($row=$db->fetch_Object($query)){
$arr_game_list[]=$row;
}
print_r($arr_game_list);
echo '{"results":"1","gameList":'.json_encode($arr_game_list).'}';
?>gameManager.php页面的内容
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title></title>
<LINK href="images/private.css" type="text/css" rel=stylesheet />
<link rel="stylesheet" type="text/css" href="../ext/resources/css/ext-all.css"/>
<script type="text/javascript" src="../ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
Ext.QuickTips.init();
Ext.BLANK_IMAGE_URL="ext/resources/images/default/s.gif";
Ext.form.Field.prototype.msgTarget = 'side';
//定义数据集对象
var gameNameStore = new Ext.data.Store({
autoLoad :true,
reader: new Ext.data.JsonReader({
totalProperty: "results",
root: "gameList",
id: "id"
},
Ext.data.Record.create([
{name: 'id'},
{name: 'name'}
])
),
proxy : new Ext.data.HttpProxy({
url : 'game.php'
})
});
new Ext.grid.GridPanel({
store:gameNameStore,
mode:'remote',
title:'简单Grid表格示例',
applyTo:'grid',
width:250,
height:150,
frame:true,
columns:[
{header:"id",width:50,dataIndex:'id',sortable:true},
{header:"姓名",width:80,dataIndex:'name',sortable:true}
]
})
});
</script>
</head>
<body><br/> <div style="width: 500px;" id="grid">
</div>
</body>
</html>这是请求得到的数据,{"results":"1","gameList":[{"id":"1","name":""},{"id":"2","name":"qqGame"},{"id":"3","name":"dsdef"}]}
但就是在grid中显示不出来,两个文件的目录结构为同一级。请大家指教。
<?php
include_once ('admin_global.php');
$query=$db->findall("gamename");
$arr_game_list=array();
while($row=$db->fetch_Object($query)){
$arr_game_list[]=$row;
}
print_r($arr_game_list);
echo '{"results":"1","gameList":'.json_encode($arr_game_list).'}';
?>gameManager.php页面的内容
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title></title>
<LINK href="images/private.css" type="text/css" rel=stylesheet />
<link rel="stylesheet" type="text/css" href="../ext/resources/css/ext-all.css"/>
<script type="text/javascript" src="../ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
Ext.QuickTips.init();
Ext.BLANK_IMAGE_URL="ext/resources/images/default/s.gif";
Ext.form.Field.prototype.msgTarget = 'side';
//定义数据集对象
var gameNameStore = new Ext.data.Store({
autoLoad :true,
reader: new Ext.data.JsonReader({
totalProperty: "results",
root: "gameList",
id: "id"
},
Ext.data.Record.create([
{name: 'id'},
{name: 'name'}
])
),
proxy : new Ext.data.HttpProxy({
url : 'game.php'
})
});
new Ext.grid.GridPanel({
store:gameNameStore,
mode:'remote',
title:'简单Grid表格示例',
applyTo:'grid',
width:250,
height:150,
frame:true,
columns:[
{header:"id",width:50,dataIndex:'id',sortable:true},
{header:"姓名",width:80,dataIndex:'name',sortable:true}
]
})
});
</script>
</head>
<body><br/> <div style="width: 500px;" id="grid">
</div>
</body>
</html>这是请求得到的数据,{"results":"1","gameList":[{"id":"1","name":""},{"id":"2","name":"qqGame"},{"id":"3","name":"dsdef"}]}
但就是在grid中显示不出来,两个文件的目录结构为同一级。请大家指教。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货