[CLOSED] Selecting a contiguous range of rows in a MultiCombo list with Shift doesn't work

  1. #1

    [CLOSED] Selecting a contiguous range of rows in a MultiCombo list with Shift doesn't work

    Hello:

    As end user, is there a way to select a contiguous range of rows in a MultiCombo list? Usually, with other components, the gridpanel for instance, I can select a contiguous range by using the Shift key. However, it doesn't seem to work with the MultiCombo component list. Also is there a way to select all items or select none using the keyboard without having to click on each item?

    To try check this https://examples2.ext.net/#/Form/ComboBox/MultiCombo/. The behaviour is the same in 3.0 : https://examples2.ext.net/#/Form/ComboBox/MultiCombo/.

    Thanks
    Last edited by Daniil; Feb 03, 2015 at 2:10 PM. Reason: [CLOSED]
  2. #2
    Hi @bogc,

    Combobox's Ext.view.BoundList uses Ext.view.BoundListKeyNav to support keyboard navigation. so you might add custom behavior to the defaultHandlers function in BoundListKeyNav to handle the SHIFT key.

    defaultHandlers: {
            up: function() {
                var me = this,
                    boundList = me.boundList,
                    allItems = boundList.all,
                    oldItem = boundList.highlightedItem,
                    oldItemIdx = oldItem ? boundList.indexOf(oldItem) : -1,
                    newItemIdx = oldItemIdx > 0 ? oldItemIdx - 1 : allItems.getCount() - 1; //wraps around
                me.highlightAt(newItemIdx);
            },
    
            down: ... 
            home: ...
            end: ...
            enter: ...
        }
    Last edited by hogaf; Jan 24, 2015 at 4:42 PM.
  3. #3
    Hello everybody,

    As for v3, I found the following way to set the MULTI selection mode. By default, there is the SIMPLE mode. Tested with the latest Ext.NET from the SVN trunk.

    Example
    <%@ Page Language="C#" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.MultiCombo1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "1", "Item 1" },
                    new object[] { "2", "Item 2" },
                    new object[] { "3", "Item 3" }
                };
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v3 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:MultiCombo 
                ID="MultiCombo1" 
                runat="server" 
                DisplayField="text" 
                ValueField="value">
                <Store>
                    <ext:Store 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>
                </Store>
                <Listeners>
                    <AfterRender Handler="this.pickerSelectionModel.setSelectionMode('MULTI');" />
                </Listeners>
            </ext:MultiCombo>
        </form>
    </body>
    </html>

Similar Threads

  1. Replies: 6
    Last Post: Oct 07, 2014, 6:51 PM
  2. Replies: 1
    Last Post: Jun 06, 2014, 6:09 AM
  3. Replies: 0
    Last Post: Jun 01, 2013, 10:41 AM
  4. Replies: 1
    Last Post: Feb 22, 2013, 1:57 AM
  5. [1.0] MultiCombo Problem Selecting
    By koss in forum 1.x Help
    Replies: 4
    Last Post: Apr 15, 2010, 3:31 PM

Posting Permissions