[CLOSED] Multiple Combo-boxes - Same Store - Odd Behavior

  1. #1

    [CLOSED] Multiple Combo-boxes - Same Store - Odd Behavior

    I have a grid with a RowEditing plugin. When in edit mode, I have four of the fields which each have a combo-box editor (employee names/ids) which all use the EmployeeData store. Each of the combo-boxes have unique IDs are are configured in the markup. When using the combo-boxes in simple, drop-down and mousing to select an item, they all work fine. However, if I use the type-ahead feature and type a name in one box, they all are filtered for that value. I don't think this is normal behavior. However, I am not sure what to expect when using a single store. For clarification here is the store:

    @(Html.X.Store().ID("EmployeeData") _
        .DataSource(ViewData("Employees")) _
        .Reader(Sub(rdr)
                        rdr.Add(New Ext.Net.JsonReader())
                End Sub) _
        .Model(Sub(mdl)
                       mdl.Add(Html.X.Model.Fields(Sub(flds)
                                                           flds.Add("Selected", Ext.Net.ModelFieldType.Boolean)
                                                           flds.Add("Text")
                                                           flds.Add("Value", Ext.Net.ModelFieldType.Int)
                                                   End Sub).IDProperty("Value"))
               End Sub))

    Here is one combo:
    cols.Add(Html.X.Column().DataIndex("DrafterEmployeeID").Text("Drafter").Renderer(New Ext.Net.Renderer() With {.Fn = "employeeRenderer"}).Editor(Sub(edt)
                                                                                                                                                                                                                Dim cbo As New Ext.Net.ComboBox
                                                                                                                                                                                                                With cbo
                                                                                                                                                                                                                    .ID = "DrafterEmployeeID"
                                                                                                                                                                                                                    .StoreID = "App.EmployeeData"
                                                                                                                                                                                                                    .MultiSelect = False
                                                                                                                                                                                                                    .AutoDataBind = True
                                                                                                                                                                                                                    .QueryMode = DataLoadMode.Local
                                                                                                                                                                                                                    .TypeAhead = True
                                                                                                                                                                                                                    .DisplayField = "Text"
                                                                                                                                                                                                                    .ValueField = "Value"
                                                                                                                                                                                                                End With
                                                                                                                                                                                                                edt.Add(cbo)
                                                                                                                                                                                                            End Sub))
    Again, the only differences in the 4 colums are:
    Column - different data index, different text
    Combo - different ID
    Last edited by Daniil; Jun 13, 2012 at 6:59 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please try to set up
    <Focus Handler="this.getStore().clearFilter();" />
    listener for the ComboBox.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Store1.DataSource = new object[] 
                { 
                    new object[] { "1", "a" },
                    new object[] { "2", "b" },
                    new object[] { "3", "c" }
                };
                this.Store1.DataBind();
            }
        }
    </script>
    
    <!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 runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Store ID="Store1" runat="server">
                <Model>
                    <ext:Model runat="server">
                        <Fields>
                            <ext:ModelField Name="value" />
                            <ext:ModelField Name="text" />
                        </Fields>
                    </ext:Model>
                </Model>
                <Reader>
                    <ext:ArrayReader />
                </Reader>
            </ext:Store>
            <ext:ComboBox runat="server" StoreID="Store1" QueryMode="Local">
                <Listeners>
                    <Focus Handler="this.getStore().clearFilter();" />
                </Listeners>
            </ext:ComboBox>
            <ext:ComboBox runat="server" StoreID="Store1" QueryMode="Local">
                <Listeners>
                    <Focus Handler="this.getStore().clearFilter();" />
                </Listeners>
            </ext:ComboBox>
        </form>
    </body>
    </html>
  3. #3
    That did it. Thank you.

Similar Threads

  1. [CLOSED] Tree Panel: Multiple selection with check boxes
    By gokcemutlu in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 16, 2011, 2:07 PM
  2. [1.0] Combo boxes not editable.
    By michaeld in forum 1.x Help
    Replies: 1
    Last Post: May 20, 2010, 10:49 AM
  3. [CLOSED] combo boxes initialization
    By alexp in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 04, 2010, 11:11 AM
  4. Problem using coolite combo boxes
    By virus in forum 1.x Help
    Replies: 3
    Last Post: Sep 19, 2009, 12:28 AM
  5. Linked Combo Boxes using DataSources
    By rthiney in forum 1.x Help
    Replies: 3
    Last Post: Aug 06, 2009, 12:36 PM

Tags for this Thread

Posting Permissions