Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    setCanEdit temporarily while startEditingNew

    Is there any way to setCanEdit(true) for a specific cell only while a user is in the process of StartEditingNew() with that cell in its row?

    I'd like a user to be able to create an entire row, but after creation of a row, not allow a user to edit a specific column.

    Any help or suggestions would be appreciated.

    #2
    Had the same issue, just override the canEditCell (int row, int col) method of the ListGrid.
    For my case to enable creation of whole rows but disable editing of the primary key columns I had done following
    Code:
    ListGrid listGrid = new ListGrid (){
              @Override
              protected boolean canEditCell (int rowNum, int colNum)
               {
                  if(!getCanEdit ())
                    {
                       return false;
                    }
                   DataSourceField field = getDataSource ().getField (getFieldName (colNum));
                        if(field.getPrimaryKey () && getRecord (rowNum) != null)
                        {
                            return false;
                        }                    
                        return true;
                    }
                };

    Comment

    Working...
    X