Hello,
I have a Table I am converting to Grid (Vaadin 7). For the Table, column 1 is always text all the way down, but columns after that are varied. So, for instance, on row 1, from column 2 until the end, it is a date, so for that, in Table, I do the following:
// Setup code, to setup columns for table
planBuckets.addContainerProperty(columnId, AbstractComponent.class, null);
planBuckets.setColumnWidth(columnId, bucketWidthAsEm * emSize );
// ..., other code snipped
and then
// Loading code, to load data into table
for( WrappedForecastBucket currentBucket : buckets )
{
forecastBucketsByColumnId.put(columnId, currentBucket);
columnId++;
DateField forecastStartDate = new DateField();
forecastStartDate.setDateFormat(dateFmt);
forecastStartDate.setResolution(Resolution.SECOND);
forecastStartDateRow.add(forecastStartDate);
// ..., other code snipped
}
// ..., other code snipped
row = forecastStartDateRow.toArray();
forecastBuckets.addItem(row, "StartDate" );
I can get away with all this because I initially add all columns as AbstractComponent.class
, so it is sort of generic. Row 2 is numeric fields, row 3 is a read only data, and row 4 is a dropdown. So what is the best way to handle this kind of scenario in Grid
?