<ext:ComboBox ID="cmbCategory" runat="server" TypeAhead="true" ForceSelection="true" DisplayField="NAME" ValueField="FIXCODE" MinChars="1" MatchFieldWidth="false" PageSize="10" FieldLabel="課程類別" LabelSeparator="" QueryMode="Default"> <Store> <ext:Store ID="Store2" runat="server" IsPagingStore="true" PageSize="10"> <Model> <ext:Model ID="Model2" runat="server"> <Fields> <ext:ModelField Name="FIXCODE" /> <ext:ModelField Name="NAME" /> <ext:ModelField Name="ID" /> </Fields> </ext:Model> </Model> </ext:Store> </Store> <ListConfig Width="320" Height="300" ItemSelector=".x-boundlist-item"> <Tpl ID="Tpl1" runat="server"> <Html> <tpl for="."> <tpl if="[xindex] == 1"> <table class="cbStates-list"> <tr> <th>課程編碼</th> <th>課程類別</th> </tr> </tpl> <tr class="x-boundlist-item"> <td>{FIXCODE}</td> <td>{NAME}</td> </tr> <tpl if="[xcount-xindex]==0"> </table> </tpl> </tpl> </Html> </Tpl> </ListConfig> <Triggers> <ext:FieldTrigger Icon="Clear" Hidden="true" /> </Triggers> <Listeners> <BeforeQuery Handler="this.getTrigger(0)[this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" /> <TriggerClick Handler="if (index == 0) { this.focus().clearValue(); trigger.hide(); }" /> <Select Handler="this.getTrigger(0).show();" /> </Listeners> <DirectEvents> <Select OnEvent="cmbCategory_SelectChange"></Select> </DirectEvents> </ext:ComboBox>
欢迎转载,转载请注明出处:http://www.cnblogs.com/Tonyyang/