那位大哥知道在jsp页面里能不能使用 类似 dbgrid 的控件(不用applet)100

lwmhyl 2003-04-01 10:41:15
那位大哥知道在jsp页面里能不能使用 类似 dbgrid 的控件(不用applet)
...全文
8 点赞 收藏 4
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
lwmhyl 2003-04-10
太好了
回复
yzxasd 2003-04-01
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
//load
function window_onload() {
initListView();
}
//初始化
function initListView()
{
var clmX,itmX
var arrHeader = new Array("名称","联系单位","联系地址","E-Mail");
for (i=1; i<=arrHeader.length; i++)
{
clmX = document.all.lv.ColumnHeaders.Add();
clmX.Text =arrHeader[i-1] ;
clmX.Width =100 ;
}
initTextbox();//清除Text的文本
}
function initTextbox(){
Text1.value ='';
Text2.value ='';
Text3.value ='';
Text4.value ='';
}
function button3_onclick() { //删除
for(i=lv.ListItems.Count;i>0;i--){
//alert(i);
if (lv.ListItems(i).Selected)
lv.ListItems.Remove(i);
}
initTextbox();//清除Text的文本
}

function button4_onclick() { //全部删除
for(i=lv.ListItems.Count;i>0;i--){
lv.ListItems.Remove(i);
}
initTextbox();
}

function button2_onclick() { //修改
for(i=lv.ListItems.Count;i>0;i--){
if (lv.ListItems(i).Selected){
lv.ListItems.Remove(i);
itmX = document.all.lv.ListItems.Add();
itmX.Text = Text1.value ;
itmX.SubItems(1) = Text2.value;
itmX.SubItems(2) = Text3.value;
itmX.SubItems(3) = Text4.value;
initTextbox();//清除Text的文本
}
}
}

function button1_onclick() { //添加
var itmX;
if (lv.ListItems.Count<10) { //不超过10个其它作者
itmX = document.all.lv.ListItems.Add();
itmX.Text = Text1.value ;
itmX.SubItems(1) = Text2.value;
itmX.SubItems(2) = Text3.value;
itmX.SubItems(3) = Text4.value;
}
}

function lv_ItemClick() { //选中某行
for(i=lv.ListItems.Count;i>0;i--){
if (lv.ListItems(i).Selected){
initTextbox();
//alert(lv.SelectedItem.Text);
Text1.value = lv.SelectedItem.Text;
Text2.value = lv.SelectedItem.SubItems(1);
Text3.value = lv.SelectedItem.SubItems(2);
Text4.value = lv.SelectedItem.SubItems(3);
}
}//--for
}

//-->
</SCRIPT>

<SCRIPT LANGUAGE=javascript FOR=lv EVENT=ItemClick>
<!--
lv_ItemClick()
//-->
</SCRIPT>
</HEAD>
<BODY LANGUAGE=javascript onload="return window_onload()">

<P style="BACKGROUND-ATTACHMENT: scroll; BORDER-BOTTOM-WIDTH: thin">
<BR>
<OBJECT id=lv
style="RIGHT: 1px; BACKGROUND-ATTACHMENT: scroll; LEFT: 1px; TEXT-TRANSFORM: capitalize; WIDTH: 402px; COLOR: lightgreen; BOTTOM: 1px; TOP: 1px; HEIGHT: 200px"
height=200 width=400 classid=clsid:BDD1F04B-858B-11D1-B16A-00C0F0283628><PARAM NAME="_ExtentX" VALUE="10636"><PARAM NAME="_ExtentY" VALUE="5292"><PARAM NAME="SortKey" VALUE="0"><PARAM NAME="View" VALUE="3"><PARAM NAME="Arrange" VALUE="1"><PARAM NAME="LabelEdit" VALUE="1"><PARAM NAME="SortOrder" VALUE="-1"><PARAM NAME="Sorted" VALUE="-1"><PARAM NAME="MultiSelect" VALUE="0"><PARAM NAME="LabelWrap" VALUE="-1"><PARAM NAME="HideSelection" VALUE="0"><PARAM NAME="HideColumnHeaders" VALUE="0"><PARAM NAME="OLEDragMode" VALUE="0"><PARAM NAME="OLEDropMode" VALUE="0"><PARAM NAME="AllowReorder" VALUE="0"><PARAM NAME="Checkboxes" VALUE="0"><PARAM NAME="FlatScrollBar" VALUE="-1"><PARAM NAME="FullRowSelect" VALUE="-1"><PARAM NAME="GridLines" VALUE="-1"><PARAM NAME="HotTracking" VALUE="0"><PARAM NAME="HoverSelection" VALUE="0"><PARAM NAME="PictureAlignment" VALUE="0"><PARAM NAME="TextBackground" VALUE="0"><PARAM NAME="_Version" VALUE="393217"><PARAM NAME="ForeColor" VALUE="-2147483640"><PARAM NAME="BackColor" VALUE="-2147483643"><PARAM NAME="BorderStyle" VALUE="1"><PARAM NAME="Appearance" VALUE="1"><PARAM NAME="MousePointer" VALUE="0"><PARAM NAME="Enabled" VALUE="1"><PARAM NAME="NumItems" VALUE="0"></OBJECT>
</P>
<P>
<BR>
<INPUT type=button CHECKED value=" 添 加 " id =button1 name=button1 LANGUAGE=javascript onclick="return button1_onclick()">    
<INPUT type=button CHECKED value=" 修 改 " id =button2 name=button2 LANGUAGE=javascript onclick="return button2_onclick()">    
<INPUT type=button CHECKED value=" 删 除 " id =button3 name=button3 LANGUAGE=javascript onclick="return button3_onclick()">    
<INPUT type=button CHECKED value="全部删除" id =button4 name=button4 LANGUAGE=javascript onclick="return button4_onclick()">
</P>
<P>名称<INPUT id=Text1 style="WIDTH: 123px; HEIGHT: 22px" size=15>
  联系单位<INPUT id=Text2 style="WIDTH: 123px; HEIGHT: 22px" size=15> </P>
<P>
联系地址<INPUT id=Text3 style="WIDTH: 123px; HEIGHT: 22px" size=15>
  电子邮件<INPUT id=Text4 style="WIDTH: 123px; HEIGHT: 22px" size=15></P>

</BODY>
</HTML>
回复
凋零的老树 2003-04-01
心大
回复
UserJavaPerson 2003-04-01
NO
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2003-04-01 10:41
社区公告
暂无公告