Fill textField with a value on a store of combo

  1. #1

    Fill textField with a value on a store of combo

    I have a combo box with custom search like https://examples3.ext.net/#/Form/Com...Custom_Search/
    when i select a item, i want to set a textfield with a value that shows on the ItemTpl called 'Correo'

    <ext:ComboBox ID="cmbNombreReporta3" runat="server" 
                            MaxLength="100" 
                            FieldLabel="Nombre de quien solicita" LabelAlign="Top" LabelStyle="font-weight:bold;"
                            DisplayField="NombreCompleto" ValueField="Id" TypeAhead="false" OnDirectChange="cmbNombreReporta_DirectChange"
                            ColumnWidth="0.33" 
                            ForceSelection="true"
                            PaddingSpec="0px 10px 0px 0px"
                            PageSize="10" 
                            AllowBlank="false"
                            HideBaseTrigger="true" MinChars="3" TriggerAction="Query">
                                    <ListConfig  LoadingText="Buscando...">
                                        <ItemTpl ID="ItemTpl4" runat="server">
                                            <Html>
                                                <div class="search-item">
                                                    <h3>{NombreCompleto}</h3>
                                                    {Correo}
                                                </div>
                                            </Html>
                                        </ItemTpl>
                                        <Listeners>
                                            <Select Handler="#{txtFieldCorreoReporta3}.setValue(#{cmbNombreReporta3}.lastSelection[0].data.Correo);" />
                                        </Listeners>
                                    </ListConfig>
                                    <Store>
                                        <ext:Store ID="Store1" runat="server" AutoLoad="false">
                                            <Proxy>
                                                <ext:AjaxProxy Url="Usuarios.ashx">
                                                    <ActionMethods Read="POST" />
                                                    <Reader>
                                                        <ext:JsonReader Root="users" TotalProperty="total" />
                                                    </Reader>
                                                </ext:AjaxProxy>
                                            </Proxy>
                                            <Model>
                                                <ext:Model ID="Model11" runat="server">
                                                    <Fields>
                                                        <ext:ModelField Name="NombreCompleto" />
                                                        <ext:ModelField Name="Correo" />
                                                        <ext:ModelField Name="Id" />
                                                    </Fields>
                                                </ext:Model>                            
                                            </Model>
                                        </ext:Store>
                                    </Store>
                        </ext:ComboBox>
    when i use firebug the code App.cmbNombreReporta3.lastSelection[0].data.Correo it give me the correct data, but the text field doesn't fill with the data.
    Attached Thumbnails Click image for larger version. 

Name:	capturafirebug.png 
Views:	5 
Size:	22.1 KB 
ID:	19921  
    Last edited by geoffrey.mcgill; Jan 29, 2015 at 11:47 PM.
  2. #2
    It's not exactly what you want but it may guide you: http://forums.ext.net/showthread.php...l=1#post238391
  3. #3
    You're setting ComboBox's value, in Select listener, with data's Correo

    <Select Handler="#{txtFieldCorreoReporta3}.setValue(#{cmbNombreReporta3}.lastSelection[0].data.Correo);" />
    But ComboBox's DisplayProperty is set to NombreCompleto. Shouldn't it be set to Correo?

Similar Threads

  1. [CLOSED] Fill Combo-box store client side based on another Combo-box selection
    By speedstepmem4 in forum 3.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 12, 2015, 5:21 AM
  2. [CLOSED] Combo query issue when using same store on two combo boxes
    By FpNetWorth in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 05, 2013, 10:53 PM
  3. fill my store from a list of object.
    By DEV_EXT_TN in forum 2.x Help
    Replies: 0
    Last Post: Aug 01, 2012, 11:54 AM
  4. Replies: 3
    Last Post: Feb 21, 2012, 10:49 AM
  5. Fill dependent combo box
    By Vaishali in forum 1.x Help
    Replies: 1
    Last Post: Jan 10, 2012, 7:36 AM

Tags for this Thread

Posting Permissions