PDA

View Full Version : Overview Page Icons not Displaying properly in Explorer Model



shajeerkt
22 Jan 2010, 11:27 PM
Dear Freinds,

i am using Gxt 2.0 with GWT 1.7

i was in the process of creating a project.
In my OverviewPage there is a problem in displaying icons. Usually by default icons should display in a horizontal manner .ie One one icon after another .
But here in my project it is displaying in a vertical manner .
ie,one icon in one row and other below that .And when i tried to click the whole row the page gets loaded .

Below is my OverviewPage code. I wondered whether this is a CSS issue..
Any one please help



public class OverviewPage extends LayoutContainer {

private ListView<ModelData> dataView;

@Override
protected void onRender(Element parent, int pos) {
super.onRender(parent, pos);

setScrollMode(Scroll.AUTO);

CdTreeModel model = (CdTreeModel Registry.get(Main.MODEL);
ListStore<ModelData> store = new ListStore<ModelData>();
store.add(model.getEntries());



StringBuffer sb = new StringBuffer();
sb.append("<tpl for=\".\">");
sb.append("<div class='sample-box' style='padding-top: 4px'>");
sb.append("<div class='thumbd'><img src='{path}' width=120 height=90></div>");
sb.append("<div>{name}</div>");
sb.append("</div></tpl>");


dataView = new ListView<ModelData>();
dataView.setItemSelector(".sample-box");
dataView.setOverStyle("sample-over");
dataView.setSelectStyle("none");
dataView.setBorders(false);
dataView.setStore(store);
dataView.setTemplate(sb.toString());
dataView.getSelectionModel().addSelectionChangedListener(new SelectionChangedListener<ModelData>() {

@Override
public void selectionChanged(SelectionChangedEvent<ModelData> se) {
if (se.getSelectedItem() != null) {
ModelData record = se.getSelectedItem();
Entry entry = (Entry) record;
Main.showPage(entry);
dataView.getSelectionModel().deselectAll();
}
}
});
add(dataView);

Image image = new Image("gxt/cd.bmp") ;

add(image,new MarginData(100,200,100,175));



}
}