1. #1
    Sencha User
    Join Date
    Jul 2013
    Posts
    3
    Vote Rating
    0
    hetal79 is on a distinguished road

      0  

    Default How to add Blank row in Simplecombobox?

    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
    411
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      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
    hetal79 is on a distinguished road

      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,734
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      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
    Posts
    147
    Vote Rating
    14
    Andreas Samjeske will become famous soon enough

      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);
    }