skhan
05-29-2008, 06:13 PM
I'm a little confused...
I modified your TreeTablePage slightly by adding this:
ButtonBar buttonBar = new ButtonBar();
buttonBar.add(new Button("Binder Remove all", new SelectionListener() {
public void componentSelected(ComponentEvent ce) {
binder.removeAll();
}
}));
buttonBar.add(new Button("Store Remove all", new SelectionListener() {
public void componentSelected(ComponentEvent ce) {
store.removeAll();
}
}));
buttonBar.add(new Button("reload", new SelectionListener() {
public void componentSelected(ComponentEvent ce) {
loader.load(null);
}
}));
add(buttonBar);
I declared all the relevant references as final so I can access them in the anonymous methods, so everything compiles fine.
I added three buttons:
Binder Remove all
Store Remove All
Reload
My question is this, how am I supposed to remove all the items from the treetable to be able to reload it with fresh data?
The reload method seems to work except it adds the elements to the current store, so I'm left with two gxt TreeTableItems at the root level say.
Neither the TreeTableBinder's nor the TreeStore's removeAll seems to work.
In fact, they both throw Javascript errors.
I haven't tested this in hosted mode to see the more meaningful messages.
Am I doing something wrong here? Is there another way for me to reload a new set of TreeTableItems?
Thanks
I modified your TreeTablePage slightly by adding this:
ButtonBar buttonBar = new ButtonBar();
buttonBar.add(new Button("Binder Remove all", new SelectionListener() {
public void componentSelected(ComponentEvent ce) {
binder.removeAll();
}
}));
buttonBar.add(new Button("Store Remove all", new SelectionListener() {
public void componentSelected(ComponentEvent ce) {
store.removeAll();
}
}));
buttonBar.add(new Button("reload", new SelectionListener() {
public void componentSelected(ComponentEvent ce) {
loader.load(null);
}
}));
add(buttonBar);
I declared all the relevant references as final so I can access them in the anonymous methods, so everything compiles fine.
I added three buttons:
Binder Remove all
Store Remove All
Reload
My question is this, how am I supposed to remove all the items from the treetable to be able to reload it with fresh data?
The reload method seems to work except it adds the elements to the current store, so I'm left with two gxt TreeTableItems at the root level say.
Neither the TreeTableBinder's nor the TreeStore's removeAll seems to work.
In fact, they both throw Javascript errors.
I haven't tested this in hosted mode to see the more meaningful messages.
Am I doing something wrong here? Is there another way for me to reload a new set of TreeTableItems?
Thanks