[CLOSED] V2.0 ComboBox Editable

  1. #1

    [CLOSED] V2.0 ComboBox Editable

    Hi, i have a problem with a combox editable, i have 2 Store, the first content the Continents and the second the Nations, load the store and in a grid panel show the Nations with GroupingSummary from Continets, in the formPanel when click on the gridpanel load the nation e the combo show the continent of the nation correctly.
    Now execute this actions:

    1) Select "Italia" from the grid panel
    2)Click in the combobox and type "Eu", it's show "Europa"
    3)Select "Cina" from the GridPanel, the combobox not show "Asia" but show "Select a state"

    He seems to have applied a filter on the combobox for "Europa"

    Now execute this actions:
    1)Open the dropdown combobox and close.
    2)Select from GridPanel "Italia" and reselect "Cina"

    it's work the combobox show "ASIA"..

    In the 1.2 it's work fine, the problem is only the type in the combobox, se not type but select the line with the mouse, it works fine.

    Here it the code for the sample:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ARWebRevolution.WebForm1" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Ext.NET v2 Example</title>
     
    </head>
    <body>
        <form id="Form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>
          <ext:Store ID="Store1" runat="server">
                <Model>
                    <ext:Model ID="Model1" runat="server">
                        <Fields>
                            <ext:ModelField Name="ConId" />
                            <ext:ModelField Name="ConCod" />
                            <ext:ModelField Name="ConDes" />                        
                        </Fields>
                    </ext:Model>
                </Model>            
            </ext:Store>
            <ext:Store ID="Store2" runat="server" GroupField="ConDes">
                <Model>
                    <ext:Model ID="Model2" runat="server">
                        <Fields>
                            <ext:ModelField Name="ConId" />
                            <ext:ModelField Name="ConDes" />
                            <ext:ModelField Name="NazId" />
                            <ext:ModelField Name="NazCod" />
                            <ext:ModelField Name="NazDes" />
                        </Fields>
                    </ext:Model>
                </Model>            
            </ext:Store>
             <ext:Viewport ID="Viewport1" runat="server" Layout="border">
            <Items>
                <ext:Panel ID="PanelNazioni" runat="server" Region="West" Width="300" BodyPadding="3"
                    Layout="FitLayout" >
                    <Items>
                        <ext:GridPanel ID="GridPanelNazioni" runat="server" Title="Nazioni"
                            StoreID="Store2" >
                            <ColumnModel>
                                <Columns>
                                    <ext:Column runat="server" ID="NazCod" DataIndex="NazCod" Align="Left" Text="Codice" Width="100" />
                                    <ext:Column runat="server" ID="NazDes" DataIndex="NazDes" Align="Left" Flex="1" Text="Nazione" />        
                                </Columns>
                            </ColumnModel>
                            <SelectionModel>
                                <ext:RowSelectionModel ID="RowSelectionModelNazione" Mode="Single" runat="server">
                                    <Listeners>
                                        <Select Handler="enableButtonRowSelect(record);" />
                                    </Listeners>
                                </ext:RowSelectionModel>
                            </SelectionModel>
                            <View>
                    <ext:GridView ID="GridViewNazioni" runat="server" StripeRows="true" MarkDirty="false" />
                </View>
                <Features>               
                    <ext:GroupingSummary ID="GroupingSummaryContinenti" runat="server" GroupHeaderTpl='{name} ({[values.rows.length]} {[values.rows.length > 1 ? "Nazioni":"Nazione"]})'>                   
                    </ext:GroupingSummary>
                </Features>
                        </ext:GridPanel>
                    </Items>
                </ext:Panel>
                 <ext:FormPanel ID="FormPanelNazione" runat="server" ButtonAlign="Right" Height="185"
                    BodyPadding="10" Padding="3"  Region="Center" Title="Nazioni...">   
                   <FieldDefaults LabelWidth="70" /> 
                   <FieldDefaults ReadOnly="false" />               
                    <Items>
                         <ext:ComboBox ID="ComboBoxContinenti" 
                runat="server" 
                StoreID="Store1" 
                Editable="true"
                DisplayField="ConDes"
                ValueField="ConId"
                TypeAhead="true" 
                QueryMode="Local"
                ForceSelection="true"
                EmptyText="Select a state..."
                SelectOnFocus="true" ReadOnly="false">            
            </ext:ComboBox>
                         <ext:TextField ID="txtNazCod" runat="server"  Width="180" AllowBlank="false"
                            BlankText="*Obbligatorio" MaxLength="4" MaxLengthText="*Lunghezza massima 4 caratteri."
                            FieldLabel="Codice" Name="NazCod" FieldCls="txtObbligatorio">
                            <ToolTips>
                                <ext:ToolTip ID="ToolTipNazCod" runat="server" Title="Codice" Html="Codice della nazione">
                                </ext:ToolTip>
                            </ToolTips>
                        </ext:TextField>
                        <ext:TextField ID="txtNazDes" runat="server"  AnchorHorizontal="100%" AllowBlank="false"
                            BlankText="*Obbligatoria" MaxLength="50" MaxLengthText="*Lunghezza massima 50 caratteri."
                            FieldLabel="Nazione" Name="NazDes" FieldCls="txtObbligatorio">
                            <ToolTips>
                                <ext:ToolTip ID="ToolTipNazDes" runat="server" Title="Continente" Html="Descrizione dela nazione" />                          
                            </ToolTips>
                        </ext:TextField>
                        
                    </Items>
                   
                </ext:FormPanel>
            </Items>
        </ext:Viewport>
          <script type="text/javascript">
    
    
              //Carica il record dalla griglia nella form e abilita i button.    
              function enableButtonRowSelect(record) {
    
                  if (record != null) {
                      App.FormPanelNazione.getForm().loadRecord(record);                 
                      App.FormPanelNazione.setTitle(record.data["NazDes"]);
                      App.ComboBoxContinenti.setValue(record.data["ConId"]);
                  };
              };
    
             
    
        </script>
        </form>
    
    </body>
    </html>
    protected void Page_Load(object sender, EventArgs e)
            {
                Store1.DataSource = new object[]
                                        {
                                            new object[] { "1", "Eu", "Europa" },
                                            new object[] { "2", "As", "Asia" }
                                        };
                Store1.DataBind();
    
                Store2.DataSource = new object[]
                                        {
                                            new object[] { "1","Europa","1","IT", "Italia" },
                                            new object[] { "2","Asia" ,"2", "CN", "Cina" }
                                        };
    
            }

    Tanks

    Aurelio
    Last edited by Daniil; Feb 23, 2012 at 12:08 PM. Reason: [CLOSED]
  2. #2
    Hi @Aurelio,

    Yes, there is the default functionality in Ext.NET v2 to filter ComboBox items on user input.

    To fix please clear filter before applying a value:
    App.ComboBoxContinenti.getStore().clearFilter();
    App.ComboBoxContinenti.setValue(record.data["ConId"]);
  3. #3
    Hi Daniil
    Tanks work OK..

    Aurelio

Similar Threads

  1. [CLOSED] ComboBox in Editable GridPanel
    By ljcorreia in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 29, 2011, 4:00 PM
  2. Editable grid with Combobox
    By dtamils in forum 1.x Help
    Replies: 0
    Last Post: Jun 23, 2011, 8:36 AM
  3. [CLOSED] Editable Combobox Not Valid Value
    By jeybonnet in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 26, 2011, 10:22 AM
  4. [CLOSED] Editable Combobox
    By 78fede78 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 13, 2010, 3:28 PM
  5. [CLOSED] Editable ComboBox issue
    By methode in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 03, 2009, 5:04 PM

Posting Permissions