1. #1
    Sencha User
    Join Date
    May 2009
    Posts
    10
    Vote Rating
    0
    gaboo is on a distinguished road

      0  

    Question Unanswered: java.util.List in Grid

    Unanswered: java.util.List in Grid


    Hi there!

    I would like to make a grid from an object which has a List type attribute.
    The data object looks like this:

    Code:
    public interface Data {
    	public String getName();
    	public List<Double> getData();		// List size = 20 for example
    }
    So the grid would have 21 columns (String, Double, Double, Double....).
    Is it possible to write a PropertyAccess<Data> interface which presents all the Doubles for the grid?

    Best regards
    gaboo

  2. #2
    Sencha User
    Join Date
    May 2009
    Posts
    10
    Vote Rating
    0
    gaboo is on a distinguished road

      0  

    Default java.util.List in Grid

    java.util.List in Grid


    Hi,

    The simple answer is a custom ValueProvider like this one:

    Code:
    public class StatValueProvider implements ValueProvider<StatRow, Integer> {
    
    
    	private int month;
    	
    	public StatValueProvider(int month) {
    		this.month = month;
    	}
    
    
    	@Override
    	public Integer getValue(StatRow object) {
    		return object.getMonths().get(month);
    	}
    
    
    	@Override
    	public void setValue(StatRow object, Integer value) {
    	}
    
    
    	@Override
    	public String getPath() {
    		return null;
    	}
    
    
    }
    In this case the StatRow.getMonths() method is a List<Integer>.

    Best regards

    G.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar