动态组合箱n级 [英] Dynamic combox n level
本文介绍了动态组合箱n级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Function thutucdequycombo(idc,i)
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = strConnection
objConn.Open
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "SELECT * From rtm_area Where parent_aid = "&idc ,objconn, 1, 3
k = rs.recordcount
j=1
while not rs.eof
IF rs("parent_aid") <> idc Then
Option_select_03 = Option_select_03 & "<option value=""" & rs("aid") & """>" & rs("name") & "</option>"
Else
Option_select_03 = Option_select_03 & "<option value=""" & rs("aid") & """> " & rs("name") & "</option>"
End IF
thutucdequycombo rs("aid"),rs("parent_aid") ' Goi lai chinh no - dequy
rs.movenext
j=j+1
'response.write" "
wend
End Function
thutucdequycombo 0,0
表格:
Table:
aid: int
name: nvachar 50
parent_id: int
我要创建动态combox n杠杆
I want create dynamic combox n lever
Leve1
1-1
1-2
Lever2
2-1
2-2
2-3
.......
推荐答案
您的"n级组合框"是众所周知的简单事情:树视图.更确切地说,它是一个带有其他元素的树视图:一个文本框(文本类型的<input>
元素),您应在其中按下键以在树视图中移动选择,就像在组合框中一样.这个附加元素的行为尚不十分清楚,因为组合框还具有几种行为模式(以一种类型实现).而且我不知道您到底需要什么行为.无论如何,您都需要自己设计和实现它.
—SA
Your "n-level combo box" is a well-known simple thing: tree view. More exactly, it''s a tree view with additional element: a text box (<input>
element of the text type) where you should handle key presses to move selection in the tree view like in a combo box. The behavior of this additional element is not quite clear, because combo boxes also has several behavioral patterns (implemented in one type); and I don''t know what exactly behavior do you need. You need to design and implement it by yourself anyway.
—SA
您在这里查看...就像图片一样
https://lh3.googleusercontent.com/-1pgC6vFayh4/UFv3- zhQGUI/AAAAAAAAAAs/k4WugcJV_yY/s779/Untitled-1.jpg
You view here ... like image
https://lh3.googleusercontent.com/-1pgC6vFayh4/UFv3-zhQGUI/AAAAAAAAAAs/k4WugcJV_yY/s779/Untitled-1.jpg
这篇关于动态组合箱n级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文