After several days of hard work, I finally completed the automatic compilation of controls, so I can't wait to share it with you.
Widget
The principle of this control is as follows: Use the listitemcollection set to save the list items and display Code As follows: < Input Name = "Txtbclass" Type = "Text" ID = "Txtbclass" Rows = "8" Matchanywhere = "True" Listallitemonfocus = "True" Style = "Width: 120px ;" />
<? XML: namespace prefix = "FSC"/>
When the control obtains the focus, it defines a timer that filters the input characters in real time and adds them to a floating layer for selection. You can also use the cursor key to move the selection and press enter to confirm the selection. After the control is selected, the client events of the control are activated.OnchangedIn onchanged, you can perform the next step, for example, filling the second-level classification with Ajax. IfAutopostbackTo activate server events.Onchanged.
< Script >
Document. getelementbyid ( " Txtbclass " ). Onchanged = Function ()
{
VaR Txtbclass = Document. getelementbyid ( " Txtbclass " ); // Category 1
VaR Txtsclass = Document. getelementbyid ( " Txtsclass " ); // Category 2
Txtsclass. Items. Clear ();
Txtsclass. Value = "" ;
If (Txtbclass. selecteditem ! = Null )
{
// Shop. webmanage. Product. getsclasslist use Ajax. Net to return the second-level list
VaR TB = Shop. webmanage. Product. getsclasslist (txtbclass. selecteditem. Value). value. Tables [ 0 ];
For ( VaR I = 0 ; I < TB. Rows. length; I ++ )
{
Txtsclass. Items. Add (Tb. Rows [I]. Text, TB. Rows [I]. value );
}
Txtsclass. savestate (); // Save to server list
}
}
</ Script >
Control client PropertiesSelecteditemReturns the selected item. The server correspondsSelecteditemAttribute.
Other attributes:
Rows: Sets the number of items displayed in the list.
Sendkeytab: Sets whether to move the cursor to the next control while pressing the Enter key.
Listallitemonfocus: Whether to display the list for selection when the cursor is obtained. Otherwise, only the characters entered are filtered.
Matchanywhere: Whether to match any character. Otherwise, match from the left.
this control has been included in faibclass. webcontrols. dll. This control has also improved pagingpanel and calendarbox controls. You can contact me if you are interested.