1. #1
    Sencha User
    Join Date
    Jun 2009
    Posts
    13
    Vote Rating
    0
    jeroni is on a distinguished road

      0  

    Default Unanswered: Getting the involved model in a EditorEvent

    Unanswered: Getting the involved model in a EditorEvent


    I'm trying to get the involved model when a Complete event fires and a EditorEvent is passed in a grid from a CellEditor.

    Code:
            TaxCombo taxCombo = new TaxCombo() {
                @Override
                public String getFormat(Tax tax) {
                    return tax.getName();
                }
            };
            taxCombo.setAllowBlank(false);
            taxCombo.hideAddButton();
            CellEditor taxComboCellEditor = new CellEditor(taxCombo);
            taxComboCellEditor.addListener(Events.Complete, new Listener<EditorEvent>() {
                @Override
                public void handleEvent(EditorEvent be) {
                    /***************************************
                            HERE IS WHERE I NEED THE INVOLVED MODEL
                    **********************************************/
    
                }
            });
            column = new ColumnConfig(getTaxIdentifier(), M.i.tax(), 70);
            column.setEditor(taxComboCellEditor);
            column.setRenderer(new GridCellRenderer<CHILD>() {
                public Object render(CHILD model, String property,
                        ColumnData config, int rowIndex, int colIndex,
                        ListStore<CHILD> store, Grid<CHILD> grid) {
                    InvoiceTypeRow row = (InvoiceTypeRow) model;
                    String taxName = "";
                    if(null != row.getTax()) {
                        taxName = row.getTax().getName();
                    }
                    return taxName;
                }
            });
    Thanks in advance

  2. #2
    Sencha User
    Join Date
    Jun 2009
    Posts
    13
    Vote Rating
    0
    jeroni is on a distinguished road

      0  

    Default


    Ok, I had to set a listener to the grid on ValidateEdit and compare the property with the desired ID of the column.