实现功能:从数据库加载出所有的数据库名,相应的数据库加载对应的数据库表名
原理:(首先看一下参考手册的内容)
异步加载Tree
tree 支持内置的异步加载模式,用户创建一个空的tree,然后定义一个远程服务器站点返回json数据用于填充tree来异步满足异步加载需求
<ul id="tree"></ul>
使用javascript加载数据
<script>
$('#tree').tree(
{
url:'tree_getData.php'
});
</script>
tree的加载是通过URL 'tree_getDat.php'站点.子节点的加载依赖于父节点的状态.当展开一个关闭节点,如果节点没有子节点加载,将发送节点id值作为http参数,参数命名为'id'到远程服务器,通过以上URL定义.检索子节点数据
查看一组从服务器返回的数据
[{
"id": 1,
"text": "Node 1",
"state": "closed",
"children": [{
"id": 11,
"text": "Node 11"
},{
"id": 12,
"text": "Node 12"
}]
},{
"id": 2,
"text": "Node 2",
"state": "closed"
}]
我们需要做的是将后台返回的数据拼凑成上述格式
前台代码即为上述代码
后台代码如下:
<?php require('./mysql_connect/mysql_connect.php');
$db_select=@mysqli_select_db($dbc,'information_schema');
if($dbc)
{
//查询所有数据库名称
$sql="select SCHEMA_NAME from schemata where SCHEMA_NAME not in
('information_schema' , 'performance_schema' , 'mysql')";
$rs=@mysqli_query($dbc,$sql);
if($rs)
{
//存储最终结果
$items=array();
//
$result=array();
while($row=mysqli_fetch_array($rs,MYSQLI_ASSOC))
{
//echo $row['SCHEMA_NAME']." ";
$result['id']=$row['SCHEMA_NAME']; //id
//中间值
$schema_name=$row['SCHEMA_NAME']; $result['text']=$row['SCHEMA_NAME']; //text
$result['state']="closed"; //state
$children=array();
//echo $schema_name." ";
//$sql="select TABLE_NAME from tables where TABLE_SCHEMA=$row['SCHEMA_NAME']"; 显示sql语句错误
$sql="select TABLE_NAME from tables where TABLE_SCHEMA='$schema_name'";
$res=@mysqli_query($dbc,$sql);
while($r=mysqli_fetch_array($res,MYSQLI_ASSOC))
{
// echo $r['TABLE_NAME']." ";
$table_name=$r["TABLE_NAME"];
array_push($children,array("id"=>$table_name,"text"=>$table_name));//childer中的id,text
$result['children']=$children; }
array_push($items,$result); //(1)
} //echo json_encode($result);(2)
echo json_encode($items); //(3)
}
}else{
echo "Connect error".mysql_connect_error($dbc);
}
?>
起初没有(1) (3),如(2)般输出,发现前台加载不出来,然后输出后台数据仔细看了大半天才发现自己个格式是这样的:
{"id":"tpss","text":"tpss","state":"closed","children":[{"id":"t_prekeychart","text":"t_prekeychart"}]}
跟要求个格式不一样,最外层少了一个[....],然后想了一下加上了(1)、(3),然后测试通过了。
上截图:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKsAAAIUCAIAAADqiUvHAAAfI0lEQVR4nO2dz4scRRTHxxBC8AdePLiKiIJz8GQm+QME/wGve5ubISwhKrnkoCiLznjxIIbMsIQlungRRgiyIiOi7C4u2UGWQQJ6C7l5MLeWJNIedrq7frxX3dPTXfW63/swhJ2e7p7K1HdeV9f7zqvOA4E3ndANEALT2RZ404kE3ogCuCMK4E55BRyNLhyNLty5cf7w+rnfvnyjwjYJPimpgKPRhTjh4aPHDx89/vXz11dqyHzY6w3nK51CKEMZBSTdv6U/4p8+e+3HT1/d3Xz5+49fuv3Ri9998PwSJ/WhAFEZAKqA6XQ6GAzAl+7cOA8pYKGDlG+vPXd8fFy0IaKAQMAKmE6n3W632+2Crx5ePxfHcfzvF65HvPXN1Wf39/eV4+bDXqfT6XQ6Sjek29LNajflddmknx46GfY6/YnyQm84t3boGO9lN2k+7HX6w2Rrf5KeobXSARRw0v3r6+ugAg7Ga7mPe7+8Hf+9+dW7T+3t7aUHJp2i/jXPui3t7OIKUM44HM6jST+VwOJPYwfrdECT5sNeR9nYSU6Z7do2TAWk3e9QQByPkEvAVhyP/vx542C8Ft/d3L58VlGA0j/px6kIYDUFGG+R/GHuYJwOaRL47u29gGgKULs/XwFI8I8eDA/Ga//9ceXmxplMAXMtBnfSGG1/xEt87tlJ057vDed6YFF30E8HNom5AgaDQVcBGwkuRPDPEH7EO4fbr9y7/dbWpdNIDEgAP2IwMDiZD3vKGKLft45JdnDEAGeTCrekiZS5G8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qfCNwtOWtH6zxrHGApQI8ZtgLIOZ5CxwC8jlD+QmOg0cj8jrkKDSk9bO0WRRF85Vd2g68CibcpjR9Gk3L/X35pch2h2gMqta9rLYTPDCFzggrmSC35Bk3qVYB93W8lkh3mjiiAO6IA7ogCuCMK4I4ogDuiAO6IArgjCuDO/6SHc121tVZ1AAAAAElFTkSuQmCC" alt="" />
下一步就是右边datagrid数据了。
额外补充:require('./mysql_connect/mysql_connect.php')的内容
<?php
/*
在建立连接到Mysql时不选择相应数据库,
在其他页面通过mysqli_select_db($dbc,db_name)选择需要连接的数据库
eg:
require ('./mysql_connect.php'); //相对路径
$db_select=mysqli_select_db($dbc,'db_name');
if(!$dbc){
#coding...
}
else{
#coding...
}
*/ define('DB_USER','root');
define('DB_PASSWORD','1234');
define('DB_HOST', 'localhost');
//连接
$dbc=@mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD) OR
die('无法连接到MySQL:'.mysqli_connect_error());
//设置字符集
mysqli_set_charset($dbc,'utf8');
?>
最后不得不说依据easyui的参考手册有些难点直接省略,实在有点坑