I am a new bee to Smart gwt. Basically I have my data structure as:
A
|_____ B1
|__C1
|__C2
|__C3
|_ B2
So i have created my ListGridRecord as follows:
public class VEPAreaRecord extends ListGridRecord{
public VEPAreaRecord(){
}
/**
* @param vepAreaName
* @param checkStations
*/
public VEPAreaRecord(String vepAreaName, String[] checkStations) {
setVepAreaName(vepAreaName);
setCheckStations(checkStations);
}
/**
* @return the vepAreaName
*/
public final String getVepAreaName() {
return getAttribute("vepAreaName");
}
/**
* @param vepAreaName the vepAreaName to set
*/
public final void setVepAreaName(String vepAreaName) {
setAttribute("vepAreaName",vepAreaName);
}
/**
* @return the checkStations
*/
public final String[] getCheckStations() {
return getAttributeAsStringArray("checkStations");
}
/**
* @param checkStations the checkStations to set
*/
public final void setCheckStations(String[] checkStations) {
setAttribute("checkStations",checkStations);
}
}
But in my ListGrid I want tp show my data as
Area1 Area2 Area3
Check1 check2 chek3
check4
check5
So basically what i want is to display my rows as columns and vice-versa. But I dont know how to acheive this. Or is there any other component which takes care of this?
Yes CubeGrid is available to Power and Enterprise license holders from Isomorphic. Check out the CubeGrid and Facets classes and take a look at the show cases on the smartgwt pages.
http://www.smartclient.com/smartgwtee/showcase/#cube_analytics and follow examples.
If you are just able to use ListGrid you can achieve the same thing through iterating through the records. If you are able to use a database you can enter customSQL
such as:
clearly these columns could be actual values in your records/db or derived (in my case derived from the datefield. I"m not a SQL guru so if there's a better way I'd love to hear it.
In the above exmple the output would be