[CLOSED] ComboBox empty ListItem

  1. #1

    [CLOSED] ComboBox empty ListItem

    Hi all,

    please, see image in attachment. I expect Firefox rendering empty ComboBox ListItem as IE does.

    Thanx

    Matteo
  2. #2

    RE: [CLOSED] ComboBox empty ListItem

    Hi,

    Don't use empty value. Not all browser correct display div/span without content (even if size defined). Please use '& nbsp;' instead empty value

    <ext:ComboBox runat="server">
                <Items>
                    <ext:ListItem Text="&amp;nbsp;" Value="0" />
                    <ext:ListItem Text="Value1" Value="1" />
                    <ext:ListItem Text="Value2" Value="2" />
                    <ext:ListItem Text="Value3" Value="3" />
                </Items>
            </ext:ComboBox>


  3. #3

    RE: [CLOSED] ComboBox empty ListItem

    ah ok, works fine.

    Thanx Vlad.

    Matteo
  4. #4

    Vlad - this isn't working for me - what's the deal?

    Quote Originally Posted by Vladimir View Post
    Hi,

    Don't use empty value. Not all browser correct display div/span without content (even if size defined). Please use '&amp; nbsp;' instead empty value

    <ext:ComboBox runat="server">
                <Items>
                    <ext:ListItem Text="&amp;nbsp;" Value="0" />
                    <ext:ListItem Text="Value1" Value="1" />
                    <ext:ListItem Text="Value2" Value="2" />
                    <ext:ListItem Text="Value3" Value="3" />
                </Items>
            </ext:ComboBox>
    Here's the javascript:

      id: "Clinic_Size_CD",
      xtype: "selectbox",
      fieldLabel: "Clinic Size",
      boxMinWidth: 300,
      dataIndex: "Clinic_Size_CD",
      displayField: "Name",
      hiddenName: "Clinic_Size_CD_Value",
      triggerAction: "all",
      valueField: "ID",
      store: this.Store2Clinic_Size_CD=new Ext.ux.data.PagingStore({
      proxyId: "Store2Clinic_Size_CD",
      autoLoad: true,
      reader: new Ext.data.JsonReader({
      fields: [{
      name: "ID"
    },{
      name: "Name"
    }],
      idProperty: "ID"
    }),
      directEventConfig: {},
      proxy: new Ext.data.PagingMemoryProxy([{"ID":3,"Name":"Large"},{"ID":2,"Name":"Medium"},{"ID":1,"Name":"Small"}], false),
      listeners: {
      load: {
      delay: 100,
      fn: function(store,records,options){if(Clinic_Size_CD.getValue() != 0){Clinic_Size_CD.setValueAndFireSelect(Clinic_Size_CD.value)}else{Clinic_Size_CD.setValue('')};autoSizeList(Clinic_Size_CD);}
    }
    }
    }),
      mergeItems: new Ext.data.SimpleStore({fields:["text","value"],data :[["&nbsp;","0"]]}),
      submitValue: true
    },
    When it puts the text into the selectbox, it shows the "&nbsp;":

    Click image for larger version. 

Name:	Untitled-1.jpg 
Views:	10 
Size:	7.7 KB 
ID:	7216
  5. #5
    Hi @ecko,

    Well, this produces the same:
    <input id="input1" type="text" />
    Ext.get("input1").dom.value = "&nbsp;"
    A similar thing happens on selecting a SelectBox's item.

    I can suggest to try the following listener for a SelectBox:
    listeners: {
        select: function (selectBox, record, index) {
            if (record.get(selectBox.valueField) === "0") {
                selectBox.setRawValue("");
            }
        }
    }

Similar Threads

  1. [CLOSED] Adding extra listitem at top combobox
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 29, 2012, 10:57 AM
  2. [CLOSED] ext:ComboBox ListItem with html image tag
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 02, 2012, 12:58 PM
  3. Replies: 0
    Last Post: May 30, 2010, 10:24 PM
  4. Replies: 0
    Last Post: Jun 26, 2009, 11:32 AM
  5. ComboBox ListItem Selected
    By Timothy in forum Bugs
    Replies: 1
    Last Post: Aug 22, 2008, 2:51 PM

Posting Permissions