Hybrid View

  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    5
    Vote Rating
    0
    bungrudi is on a distinguished road

      0  

    Question How to align form controls in non-editable grid?

    How to align form controls in non-editable grid?


    Hello,

    Basically I have a non-editable grid (a TreeGrid instead of EditorTreeGrid), and in one column I'm rendering form widgets using GridCellRenderer, something like this (simplified a lot):
    Code:
    new GridCellRenderer<FinancialInfoTreeModel>() {
                @Override
                
                public Object render(FinancialInfoTreeModel treeModel, String property, ColumnData config, int rowIndex, int colIndex, ListStore<FinancialInfoTreeModel> baseTreeModelListStore, Grid<FinancialInfoTreeModel> baseTreeModelGrid) {
                      SimpleComboBox cb = new SimpleComboBox();
                      // some logic goes here to populate selection and regulate what happens on cb.onChange
                      return cb;
               }
    }
    The problem is that the rendered combo boxes are aligned left.
    I tried using columnConfig.setAlignment(Style.HorizontalAlignment.RIGHT) to no effect.
    Thus the question, how do I right-align form controls in a non editable grid?

    Many thanks.

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Nov 2010
    Posts
    209
    Vote Rating
    -2
    Ersmarker has a little shameless behaviour in the past

      0  

    Default


    You can set style attribute float: right on the combobox

    Code:
    SimpleComboBox cb = new SimpleComboBox();
    cb.setStyleAttribute("float", "right");

Thread Participants: 1

Tags for this Thread