dropdownlist+ server-side data that can be entered

Source: Internet
Author: User
When you change a desktop program to a Web program, a Infragistics control used in the original program can be both input and down, and the Drop-down display as a table, although Infragistics also provides such web controls, but there are some bugs during use. Settings are also more cumbersome. So I had to write it myself.
But not as a control, versatility is poor
1. On the server side, the selectable values are directed in a DataGrid, and the display = ' None ' of this DataGrid is set.
2. Then set the Onlick value of each item in the DataGrid on the server side
For i = 0 to DGD. Items.count-1
Dgd. Items (i). Attributes.Add ("onclick", "Show" "" + DGD. Items (i). Cells (0). Text.trim + "" ", '" + txt. ClientID + "')")
Dgd. Items (i). Attributes.Add ("OnMouseOver", "this.classname= ' sel ';")
Dgd. Items (i). Attributes.Add ("onmouseout", "this.classname= ' params ';")
Dgd. Items (i). CssClass = "params"
Next
Here must be set at the client click on a row in that control reality what value
3. Also set the client event for the clicked picture on the server side
Img. Attributes.Add ("onclick", "lstparams" + txt. ClientID + "', '" + DGD. ClientID + "')")
Shows which of the DataGrid values are under which textbox
4. Copy the value in the hidden DataGrid to display in client JavaScript to a DIV and set the display position
/<div Id=divparams
Style= "Display:none; z-index:102; left:288px; width:200px; Position:absolute; top:264px; height:115px "/>/</div/>
function Lstparams (TXTBOX,DGD) {var x,y; var dd=document.all[' divparams ']; var dpar=document.all[dgd]; var e =document.a Ll[txtbox]; var str; var y=e.offsettop+e.offsetheight; var x=e.offsetleft; while (e=e.offsetparent) {y+=e.offsettop; X+=e.offsetleft}
str=dpar.innerhtml;
Dd.innerhtml= "/<table class= ' paramtb ' rules= ' all '/> ' +str+"/</table/> ";
With (Dd.style) {left = x, top =y;}}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.