[CLOSED] Filtering Combo question

  1. #1

    [CLOSED] Filtering Combo question


    see the code behind that adding a column to a grid. there are 40-50 rows. Notice how we assign Store1 one. Now assume each row has a different value.

    The problem is that i want to mark the ComboBox as editable so when the user selects the combo, they can type and it will be searchable. The problem is since the Store1 is shared to ALL records, the filtered store now affects ALL the rows and messes them up.

    How can i utilized ONE store but still allow the proper filtering on an individual row basis?


                //emp column
                Column.Config eColumnConfig = new Column.Config();
                eColumnConfig.Text = "Column";
                eColumnConfig.DataIndex = "data1";
                eColumnConfig.Width = 150;
                eColumnConfig.CellWrap = true;
                Ext.Net.Column eColumn = new Column(eColumnConfig);
                eColumn.ID = "employeeOid";
                eColumn.Renderer.Fn = "employeeOidRenderer";
                FieldTrigger fieldTrigger = new FieldTrigger();
                fieldTrigger.Icon = TriggerIcon.Clear;
                fieldTrigger.Handler = "this.clearValue();";
                ComboBox cb2 = new ComboBox();
                cb2.StoreID = "Store1";
                cb2.ValueField = "blah";
                cb2.DisplayField = "text";
                cb2.Editable = false;
                cb2.ForceSelection = true;
                cb2.ListConfig = new BoundList();
                cb2.ListConfig.MinWidth = 400;
                cb2.ListConfig.MaxHeight = 800;
  2. #2
    Hello @Z!

    I believe what you could use is typeahead to reduce the number of displayed records in a combo box.

    As filtering is applied to the store, some things else you could do to retain the store-filtering feature would be:
    - use individual stores with the same model -- which would mean the data multiplied on the page by the number of rows (40-50).
    - dynamically apply the filters as the combo boxes' picker dropdown is expanded, and retain what's filtered in the combo box scope -- so the filter is applied on dropdown/picker expand, and re-applied when another combo box is expanded. You'll probably require client-side code to bind the desired filter to (for example) each combo box component (like App.ComboBox1.myOwnFilter).

    How does it sound for you? In one side, you'd get best speed (no constant filter re-applying) by using individual stores, on the other hand, save memory by dynamically re-applying filters. Beyond that line, it will filter the combo as the user types if using type-ahead.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    I dont think i want a separate store per row. We have have hundreds of rows and each combo can be 1000-2000 elements. dynamic bind seems the solution. Do you have a working example of such? If not, can you provide one please (and then you can add it to the examples explorer)

  4. #4
    Hello @Z!

    Glad one of the alternatives seems feasible for you.

    First I think only in adding events to focus-out and focus-in (OnBlur and OnFocus) to add and remove the filters. But before we can provide you the exact way that you could possibly do it -- and we'd be pleased to help in that -- we'll have you to provide us a runnable test case of the scenario you want to reproduce (with mock data, of course), so we can ensure we stay within the requirements you have and we're talking about the same scenario.

    Depending on how that is, it would even change the actual "best way" to implement that and the dynamic filter may be unnecessary at all.

    Looking forward to your follow-up!
    Fabrício Murta
    Developer & Support Expert
  5. #5

    you can close this. i implemented a very simple solution.

    I created a second store "RenderStore." On load of the original store, i make a by value copy to my render store. Now, i can filter my original store at will via the "Expand" listener dynamically. Then i use the RenderStore in my renderer so all displays properly.


Similar Threads

  1. Replies: 1
    Last Post: Feb 17, 2015, 7:03 PM
  2. [CLOSED] Simple combo box question
    By rmelancon in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: May 06, 2014, 11:42 AM
  3. [CLOSED] Question about event calls by combo box value.
    By rosua in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 19, 2012, 11:53 AM
  4. Replies: 4
    Last Post: Nov 11, 2010, 11:46 AM
  5. Grid (Store) filtering question
    By quasimidi in forum 1.x Help
    Replies: 2
    Last Post: Jun 15, 2010, 9:10 AM

Posting Permissions