snippet of the load of the columns...
we have developed a simple model class to support the load:
Code:
public class ColumnProp {
String m_colSequence;
String m_colWidth;
...
//getters and setters!
}
then get the columns of the grid from the db and set it to the grid
Code:
do {
ColumnProp colProp = new ColumnProp();
colProp.setColSequence(tds[1].getString("col_seq"));
colProp.setColWidth(tds[1].getString("col_width"));
setGridColumnProps(tds[1].getString("grid_name"),colProp);
} while (tds[1].next());
and at last the method to set the columns to a grid
Code:
public void setGridColumnProps(String key, ColumnProp colProp) {
if (key != null && !(key.equals(""))){
InteractionObjectGrid grd = m_gridCol.get(key);
if (grd != null) {
if (colProp.getColSequence() != null && !(colProp.getColSequence().equals("")) ){
grd.setColumnsequence(colProp.getColSequence());
}
if (colProp.getColWidth() != null && !(colProp.getColWidth().equals("")) ){
grd.setModcolumnwidths(colProp.getColWidth());
}
}
}
}