[FIXED] [1.7] MultiCombo Value/Selection Problem (v1.4)

  1. #1

    [FIXED] [1.7] MultiCombo Value/Selection Problem (v1.4)

    Hi All,

    When the value of an item of a MultiCombo contains leading or trailing spaces that item cannot be selected, neither by mouse nor markup.
    Is this a bug or by design?

    <ext:MultiCombo runat="server" FieldLabel="Teminatlar" Mode="Local">
                        <Items>
                            <ext:ListItem Value=" A " Text="ALL CATEGORIES"/>
                            <ext:ListItem Value="C1" Text="CATEGORY 1"/>
                        </Items>
                        <SelectedItems>
                                <ext:SelectedListItem Value=" A "/>
                        </SelectedItems>
    </ext:MultiCombo>
    Thanks in advance,

    TDL
    Last edited by Daniil; Dec 04, 2012 at 8:46 AM. Reason: [FIXED] [1.7]
  2. #2
    Hi @thedarklord,

    Thank you for the report.

    It works in Ext.NET v2.

    And, I think it should work the same way in Ext.NET v1.

    But there is a possibility that a change can break some existing applications.

    So, I create a new property - TrimSpaces. It is true by default. So, please change it to false to get the behavior you need.

    Please get the sources from SVN or wait v1.7 (no date yet) or just use this fix without any other changes.

    Fix (put into a page's <head>)
    <ext:ResourcePlaceHolder runat="server" Mode="ScriptFiles" />
        
    <script type="text/javascript">
        Ext.net.MultiCombo.override({
            normalizeStringValues : function (s) {
                if (!Ext.isEmpty(s, false)) {
                    var values = [],            
                        re = /^\[{1}|\]{1}$/g;
    
                    s = s.toString().replace(re, "");
                }
            
                return s;
            }
        });
    </script>

Similar Threads

  1. [CLOSED] MultiCombo selection via script
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Sep 21, 2012, 12:44 PM
  2. MultiCombo that Remember Selection through page
    By MichaelSogos in forum Examples and Extras
    Replies: 1
    Last Post: Sep 21, 2011, 3:50 PM
  3. [CLOSED] Combo Box Pre-Selection Problem
    By IanPearce in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jun 07, 2011, 3:43 PM
  4. Problem with TreePanel Selection[1.0]
    By suchit_patel in forum 1.x Help
    Replies: 0
    Last Post: Jul 21, 2010, 8:38 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