rmulcha
8 Mar 2012, 12:22 PM
Hello there..,
I am a beginner to GXT and we are trying out this for a new project, I need some help with below.
I have a grid with RowExpander and I need to retrieve the additional data which need to be shown on row expansion by making an ajax call. I was trying that by setting that data in the onBeforeExpand event listener, but didnt work for me, can someone pls help me with this. Added my code below.
Thank you for your help
XTemplate tpl = XTemplate.create("<div><table class=\"simple-table\" width=\"50%\"><tr><th>Timestamp</th><th>Name</th><th>Description</th><th>Broker</th></tr><tpl for=\"events\"><tr><td>{timestamp}</td><td>{name}</td><td>{desc}</td><td>{broker}</td></tr></tpl></table></div>");
final RowExpander expander = new RowExpander();
expander.setTemplate(tpl);
expander.addListener(Events.BeforeExpand, new Listener<RowExpanderEvent>() {
@Override
public void handleEvent(RowExpanderEvent be) {
//This getDummyEvents is the one which will call the service and getData and updates the model object
((Transaction)be.getModel()).setEvents(getDummyEvents());
}
});
List<ColumnConfig> configs = getColumnConfigs(expander);
ColumnModel columnModel = new ColumnModel(configs);
final Grid<BeanModel> grid = new Grid<BeanModel>(store, columnModel);
grid.addPlugin(expander);
}
I am a beginner to GXT and we are trying out this for a new project, I need some help with below.
I have a grid with RowExpander and I need to retrieve the additional data which need to be shown on row expansion by making an ajax call. I was trying that by setting that data in the onBeforeExpand event listener, but didnt work for me, can someone pls help me with this. Added my code below.
Thank you for your help
XTemplate tpl = XTemplate.create("<div><table class=\"simple-table\" width=\"50%\"><tr><th>Timestamp</th><th>Name</th><th>Description</th><th>Broker</th></tr><tpl for=\"events\"><tr><td>{timestamp}</td><td>{name}</td><td>{desc}</td><td>{broker}</td></tr></tpl></table></div>");
final RowExpander expander = new RowExpander();
expander.setTemplate(tpl);
expander.addListener(Events.BeforeExpand, new Listener<RowExpanderEvent>() {
@Override
public void handleEvent(RowExpanderEvent be) {
//This getDummyEvents is the one which will call the service and getData and updates the model object
((Transaction)be.getModel()).setEvents(getDummyEvents());
}
});
List<ColumnConfig> configs = getColumnConfigs(expander);
ColumnModel columnModel = new ColumnModel(configs);
final Grid<BeanModel> grid = new Grid<BeanModel>(store, columnModel);
grid.addPlugin(expander);
}