Search code examples
javagwtgxt

How to migrate from GXT 2.2.3 to GXT 3.0.1


I created EditorGrid using GXT 2.2.3.Everything required is over.But at one point I stucked i.e I need to disable and enable some cells based on the value in one cell.I asked Question for this How to make cell as non editable based on another cell value in Editable Grid in gxt. But I got the solution that doesn't working for me.I asked in Sencha,coderanch and some other forums,but still I didn't got solution.

Now I decided to migrate this to GXT 3.0.1.

I need an EditableGrid and need to disable and enable the cell editing based on the value in another Cell.Please suggest which grid is suitable for this in GXT 3.0.1 and how to migrate to GXT 2.2.3 to GXT 3.0.1.


Solution

  • I resolved this by just using CSS. Instead thinking of disabling and enabling the cell, I just hide and show the cell using CSS. Below is my code which saves me to reach this requirement.

     GridCellRenderer<AttendanceCaseCreationModel> checkinRenderer=new GridCellRenderer<AttendanceCaseCreationModel>() {
    
            @Override
            public Object render(AttendanceCaseCreationModel model, String property,
                    ColumnData config, int rowIndex, int colIndex,
                    ListStore<AttendanceCaseCreationModel> store,
                    Grid<AttendanceCaseCreationModel> grid) {
    
                String color="pink";
                if(eventcombo.getValue()!=null){
    
    
                    if(eventcombo.getRawValue().equalsIgnoreCase("Forgot To Checkin") || 
                            eventcombo.getRawValue().equalsIgnoreCase("Mark/Modify Attendance")){
                        color="pink";
                    }
                    else{
    
                        config.style=config.style+ ";visibility: hidden;";
                    }
    
                }
    
                config.style=config.style+ ";background-color:" + color  + ";";
                config.style=config.style+ ";display: block;";
                Object value = model.get(property);
                return value;
    
            }
        };