It is little complex to show the data in ext.net combobox from database . But if you know the way it is soo easy...I am not showing the steps.Try to understand the code...
<div>
<ext:ResourceManager ID="ResourceManager1" runat="server">
</ext:ResourceManager>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:EMAIL_DBConnectionString %>"
SelectCommand="SELECT [tx_tempName] FROM [T_TEMPLATE]"></asp:SqlDataSource>
<ext:Store ID="tx_tempName" runat="server" DataSourceID="SqlDataSource1">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="tx_tempName" Type="String" Mapping="tx_tempName" />
</Fields>
</ext:JsonReader>
</Reader>
<SortInfo Field="tx_tempName" Direction="DESC" />
<Listeners>
<LoadException Handler="Ext.Msg.alert('Employee Type - Load failed', e.message || e )" />
<Load Handler="#{cmbEmployeeType}.setValue(#{cmbEmployeeType}.store.getAt(0).get('id'));" />
</Listeners>
</ext:Store>
<ext:ComboBox ID="tx_tempNameCombo" StoreID="tx_tempName" runat="server" Width="270"
Editable="true" DisplayField="tx_tempName" ValueField="tx_tempName"
TypeAhead="true" Mode="Local" ForceSelection="true" TriggerAction="All" Select="onfocus=true">
</ext:ComboBox>
</div>
No comments:
Post a Comment