PDA

View Full Version : Paging ToolBar Hidden till I collapse the panel



Yosef Toros
24 Jun 2008, 2:34 AM
Hi ,
I am trying to create a pageble grid, the Pging ToolBar is hidden tilI collapse and expand the panel, any ideas?

Code :
public class DisputesTable extends LayoutContainer {
protected void onRender(Element element, int i) {
super.onRender(element, i);
final EZTrustRemoteServiceAsync service = EZTrustRemoteService.App.getInstance();
if (service == null) {
MessageBox box = new MessageBox();
box.setButtons(MessageBox.OK);
box.setIcon(MessageBox.INFO);
box.setTitle("Information");
box.setMessage("No service detected");
box.show();
return;
}
FlowLayout layout = new FlowLayout(10);
setLayout(layout);
List<TableColumn> columns = new ArrayList<TableColumn>();
columns.add(new TableColumn("category", "category", 150));
columns.add(new TableColumn("description", "description", 100));
columns.add(new TableColumn("source", "source", 200));
columns.add(new TableColumn("risk", "risk", 100));
// create the column model
TableColumnModel cm = new TableColumnModel(columns);
Table table = new Table(cm);
RpcProxy proxy = new RpcProxy() {
@Override
public void load(Object loadConfig, AsyncCallback callback) {
service.getDisputes((PagingLoadConfig) loadConfig, callback);
}
};
// loader
final BasePagingLoader loader = new BasePagingLoader(proxy);
loader.setRemoteSort(true);
// store
ListStore<DisputeBM> store = new ListStore<DisputeBM>(loader);
// binder
new TableBinder<DisputeBM>(table, store);
final PagingToolBar toolBar = new PagingToolBar(50);
toolBar.bind(loader);
ContentPanel panel = new ContentPanel();
panel.setFrame(true);
panel.setCollapsible(true);
panel.setAnimCollapse(false);
panel.setButtonAlign(Style.HorizontalAlignment.CENTER);
panel.setIconStyle("icon-table");
panel.setHeading("Paging Table");
panel.setLayout(new FitLayout());
panel.setTopComponent(table);
panel.setSize(600, 450);
panel.setBottomComponent(toolBar);
panel.add(toolBar);


// load after rendering
DeferredCommand.addCommand(new Command() {
public void execute() {
loader.load(0, 50);
}
});
add(panel);
}
}

gslender
24 Jun 2008, 4:57 AM
after loader.load call layout on the panel...

Yosef Toros
24 Jun 2008, 5:09 AM
after loader.load call layout on the panel...


can you be very king and give an example , I did not understand your anwer...

gslender
24 Jun 2008, 5:29 AM
DeferredCommand.addCommand(new Command() {
public void execute() {
loader.load(0, 50);
panel.layout(); /// <<<<< add this line.... (you'll need to make panel final)
}
});

Yosef Toros
25 Jun 2008, 1:15 AM
Unfortunately this solution does not solve the problem ...

darrellmeyer
25 Jun 2008, 7:16 AM
If you post some test code in this format (http://extjs.com/forum/showthread.php?t=33778) I will take a look.