Results 1 to 5 of 5

Thread: How to add Blank row in Simplecombobox?

  1. #1
    Sencha User
    Join Date
    Jul 2013
    Posts
    3
    Vote Rating
    0
      0  

    Default How to add Blank row in Simplecombobox?

    How to add Blank row in Simplecombobox in GXT 3?

  2. #2
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    413
    Vote Rating
    21
      0  

    Default

    Since the combo box is backed by a store, you'll need to add a <T> such that the result of your LabelProvider returns an empty string.

    Note that I have not tested this. It is possible that the UI will collapse this cell to not be the same height as the other cells in which case we'll need to try something else.

  3. #3
    Sencha User
    Join Date
    Jul 2013
    Posts
    3
    Vote Rating
    0
      0  

    Default

    I want empty row of same height. Empty string will give very thin blank row. GXT 2 has setTemplate option by which we can achieve it. I want someway in gxt 3.

  4. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737
    Vote Rating
    93
      0  

    Default

    In the same way that you can use a template in gxt 2 (I think you draw a <br/>, though I don't recall, could be something with line-height instead), you can specify a SafeHtmlRenderer that returns custom html for any given value - pass this to the com.sencha.gxt.widget.core.client.form.ComboBox.ComboBox(ListStore<T>, LabelProvider<? super T>, SafeHtmlRenderer<T>) constructor. This can of course use an xtemplate - same basic impl as you used in GXT 2 should be acceptable and useful here, though with the GXT 3 version of XTemplates.

  5. #5
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223
    Vote Rating
    24
      0  

    Default

    For making the empty entry same size, we added each entry a nbsp; via XTemplates.

    Code:
    public interface ComboBoxTemplates extends XTemplates {
        
        public final static ComboBoxTemplates INSTANCE = GWT.create(ComboBoxTemplates.class);
        
        @XTemplate("{text}&nbsp;")
        SafeHtml value(String text);
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •