ghatfan99
11 Aug 2010, 12:50 AM
hello,
me problem is that i have an class Agent and one of his attribute is abilities witch is a list of string like("barMan","hero",... ), in my Grid i want that the field returns a line for every ability and i use this code:
GridCellRenderer<Agent> agentSpecialities = new GridCellRenderer<Agent>()
{
@Override
public Object render(Agent model, String property,
com.extjs.gxt.ui.client.widget.grid.ColumnData config,
int rowIndex, int colIndex, ListStore<Agent> storeAgent, Grid<Agent> gridAgents)
{
if(model.getAbilities() == null)
{
return ("agent without abilities");
}
return model.getAbilities();
}
};
but the result of this code is:
[bareMan, hero] in the same line.
i know that i must use a listStore for saving the abilities, but the listStore doesn't work with String value.
did you have some ideas.
me problem is that i have an class Agent and one of his attribute is abilities witch is a list of string like("barMan","hero",... ), in my Grid i want that the field returns a line for every ability and i use this code:
GridCellRenderer<Agent> agentSpecialities = new GridCellRenderer<Agent>()
{
@Override
public Object render(Agent model, String property,
com.extjs.gxt.ui.client.widget.grid.ColumnData config,
int rowIndex, int colIndex, ListStore<Agent> storeAgent, Grid<Agent> gridAgents)
{
if(model.getAbilities() == null)
{
return ("agent without abilities");
}
return model.getAbilities();
}
};
but the result of this code is:
[bareMan, hero] in the same line.
i know that i must use a listStore for saving the abilities, but the listStore doesn't work with String value.
did you have some ideas.