Question

I am working on GXT 2.5.5

I have desinged a GRID in a project

In one column of the grid i have render a composite

It looks like this

Grid

This Choose evaluation column is Composite which is rendered in the Grid.

public class Evaluation extends Composite {
    private RadioGroup rdgrpEvaluation;
    private Radio radio_1;
        // More radion buttons
    private Radio radio_10;        
}

All the radio_x.setValue(true) in the grid are set from the Model

int key = model.get("radioEvaluation");
switch (key) {
    case 1:
         evaluation.getRadio_1().setValue(true);
         break;// more similar code

Now i want that when I click on radio button, the value of the Evalution column should also change.

Can some body help ?

Was it helpful?

Solution

I think that simplest way is call refresh whole table after selecting some button:

grid.getView().refresh(false);

But you also need to update your model. When You click on radio button you may set value to your model like^

data.setEvalueation(int selectedRadio);

Or You can create specified ValueProvider to Evaluation column

     ColumnConfig<Data,String> evaluationColumn = new ColumnConfig<Data, String>(new ValueProvider<Data>() {
                @Override
                public String getValue(Data o) {
                    String value = o.getRadioColumnValue();
                    return value;
                }

                @Override
                public void setValue(Data o, Data o2) {

                }

                @Override
                public String getPath() {
                    return "evaluation";
                }
            });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top