关于在IE环境下画树的问题,功能类似于TTreeView(200分)

  • 主题发起人 穿越迷雾
  • 开始时间
穿

穿越迷雾

Unregistered / Unconfirmed
GUEST, unregistred user!
我们正在使用websnap技术开发ERP项目,所以客户端是IE形式,
其中BOM(物料)表需要以树的形式实现,但在IE下画树不知道该怎么做,
能否用ActiveX技术呢?
无论接触没接触过,希望各位能给予帮助, 发表一下意见,先谢谢各位了!:)
 
各位怎么不发言呢,急呀,快没饭吃了。
 
小生初来诈道,拿出一半的积蓄分给大家,希望能给一个思路,为什么没有人感兴趣呢。
痛苦!!
 
可用jScript啊,网上很多例子,用goole瘦一把
 
使用 Intraweb 控件
带例子自己看吧
 
谢谢,
还有没有其它办法,我没有接触过JSCIPT
 
对呀,使用脚本控制
就是使用图片拼出来的树的结构
网上真的很多的
 
以前做网站的时候,用PHP写过一个TreeView。
是从数据库中提取资料,父级子级有标志,动态嵌套了HTML代码,然后递归形成一棵树,在IE中使用。
网上了例子也很多的,给你作个参考吧。
-----------------
<?
////////////////////////////////////////////////////////////////////////////////////////////
// //
// //
// 本模块的思想如下:在主体中调用函数SectionTitle_print(),使函数得到 //
// 初值(顶级栏目),SectionTitle_print()将初值传递给 //
// write($Section_Title,$Section_No)函数,到此, //
// write($Section_Title,$Section_No)函数根据初值就可以进行递归运算。 //
// //
// write($Section_Title,$Section_No) 判断是否是末级标志,如果不是末级标志,则显示 //
// 标题,将标题的编号传递给SectionTitle_query($Section_No) 函数,进行子级栏目的查找, //
// 每一个子级栏目又调用 write($Section_Title,$Section_No) 判断是否是末级标志(进行递归) ,//
// 直到到达末级目录(递归停止),将末级目录打印出来。 //
// write($Section_Title,$Section_No)与SectionTitle_query($Section_No)是 “递归体 ”。 //
// 需要注意的是每次递归都需要保存旧的游标,使用(打开)一个新的游标,使用数组保存游标。//
// //
/////////////////////////////////////////////////////////////////////////////////////////////
//--- 调用php模块---------------

include("/jrq/tree_connect.php")
//建立tree 的连接
$cursor1 = ora_open($handle)
// 在SectionTitle_print() 函数中使用此游标
$cursor3 = ora_open($handle)
// 在write($Section_Title,$Section_No) 函数中使用此游标
$i=0;
ora_commiton($handle)
//打开自动更新数据库的功能


//------------------------------------------------------------|
// 主体第一次调用函数(注意此函数不递归) |
//------------------------------------------------------------|
function SectionTitle_print()
{
global $cursor1;

$Bottom_Flag=0;
$query = "SELECT SectionTitle,SectionNo
from TbSection
where SectionNo>0 and SectionNo<=99";//查找顶级栏目标题(SectionTitle)

ora_parse($cursor1, $query) or die(" 查找栏目失败! ")
//分析sql语句
ora_exec($cursor1);//执行 Oracle 的指令区

while(ora_fetch($cursor1))
{
$Section_Title = trim(ora_getcolumn($cursor1,0));
$Section_No = trim(ora_getcolumn($cursor1,1));
write($Section_Title,$Section_No);
//调用函数,即将初值(顶级栏目)传递给write函数,然后write函数进行递归调用
}
}

//|----------------------------------------------|
//| 递归调用函数 |
//|----------------------------------------------|
function SectionTitle_query($Section_No)
{
global $handle,$i
// 注意使用全局变量,$handle传递过来使每次递归使用 ora_open($handle)打开一个游标

$i++
//游标计数,使每一次递归都重新使用游标

$cursor2[$i] = ora_open($handle);//因为是递归,所以每一次使用一个新的游标,到本次递归结束,则使用上一次的游标(i--)

$query = "SELECT SectionTitle,SectionNo
from TbSection
where SectionNo>($Section_No*100+0) and SectionNo<=($Section_No*100+99)";//查找顶级栏目标题(SectionTitle)

ora_parse($cursor2[$i], $query) or die(" 查找子级栏目失败! ")
//分析sql语句
ora_exec($cursor2[$i]);//执行 Oracle 的指令区

while(ora_fetch($cursor2[$i]))
{
$Section_Title = trim(ora_getcolumn($cursor2[$i],0));
$Section_No = trim(ora_getcolumn($cursor2[$i],1));
write($Section_Title,$Section_No);
}
$i--
// 循环完毕后,退出本次递归,计数游标减一,使用上次的游标进行下次循环 style=/"cursor:hand/
}

//--------------------------------------------------------------------|
// 递归函数调用 |
//--------------------------------------------------------------------|

function write($Section_Title,$Section_No)
{
global $cursor3,$i;

//|-------------------------------------|
//| 查找是否是末级编号 |
//|-------------------------------------|

$query = "select SectionBottomFlag
from TbSection
where SectionNo=$Section_No";

ora_parse($cursor3, $query) or die(" 查找栏目对应的编号失败! ")
//分析sql语句
ora_exec($cursor3);//执行 Oracle 的指令区

if (ora_fetch($cursor3))
{
$Bottom_Flag=ora_getcolumn($cursor3,0);
}
//---------------------------------------------------------------------

if ($Bottom_Flag==1)
{ //
echo"
<TR>
<TD align=middle height=20 width=11><IMG height=18 id=image[$Section_No] src=/"picture/heart.gif/" width=18></TD>
<TD height=20 width=/"665/" colspan=2><A href=/"Pub_Can_save.php?Section_No=$Section_No/" target=/"main/"><font face=/"宋体/" size=/"2/">$Section_Title</A></font></TD>
</TR>";
}

if ($Bottom_Flag==0)
{
echo"
<TABLE border=0 cellPadding=0 cellSpacing=0 width=682>
<TR>
<TD align=middle height=20 width=11 vAlign=top><IMG height=20 id=image$Section_No onmouseup=block_open('$Section_No') src=/"picture/fly_ball.gif/" width=20></TD>
<TD height=20 width=665><font face=/"宋体/" size=/"2/"><a href=/"Pub_Can_save.php?Section_No=$Section_No/" onclick=/"block_open('$Section_No')
return false/">$Section_Title</a></font></TD>
</TR>

<TR>
<TD align=middle vAlign=top width=11></TD>
<TD id=tabel$Section_No style=/"display: none/" width=665>
<DIV align=left>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=670>
<TBODY>";
SectionTitle_query($Section_No);
echo"</TBODY>
</TABLE>
</DIV>
</TD>
</TR>";
}
}



?>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html
charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<SCRIPT language=javascript>
<!--

function block_open(Section_No)
{
tabel=eval("tabel"+Section_No);
image=eval("document.tree_form.image"+Section_No);

if (tabel.style.display =='none')
{
image.src="picture/blue_ball.gif";
tabel.style.display='block';
}
else
{
tabel.style.display ='none';
image.src="picture/fly_ball.gif";
}
}

-->
</SCRIPT>

<body bgcolor="#FFC993">

<form name=tree_form method="POST" action="--WEBBOT-SELF--">

<?
SectionTitle_print();
?>
</form>

</body>
 
to savetime:
谢谢,delphi7中带吗?
可我们用的是websnap技术,Intraweb 控件用的是另一套技术啊
 
delphi7自带Intraweb,但具体的技术差别我就不知道了
没实际用过。
 
各位:不用脚本语言可不可以实现呢?或者有多大难度呢
 
多人接受答案了。
 

Similar threads

D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
902
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
顶部