PDA

View Full Version : [GXT 2.0-m3] Drag and Drop by TreePanel :: Problem



explido Software
21 Jun 2009, 11:07 PM
Hallo,
I get constantly by Drad and Drop in my TreePanel "Jist in time"-Error.

I do not understand where the error comes. Can you help me, please.


GXT 2.0-m3




treeStore = new TreeStore<BeanModel>();
final DocumentServiceAsync documentService = DocumentService.Util.getInstance(DocumentService.SERVICE_URI_GET_DOCUMENTS);

documentService.getDocuments(new Document(), new AsyncCallback<List<Document>>() {
public void onFailure(Throwable throwable) {
}

public void onSuccess(final List<Document> result) {
for (Document document : result) {
BeanModel documentModel = BeanModelLookup.get().getFactory(Document.class).createModel(document);
treeStore.add(documentModel, true);
treeStore.add(documentModel, BeanModelLookup.get().getFactory(Content.class).createModel(document.getContents()), true);
}
}
});


tree = new TreePanel<BeanModel>(treeStore);
tree.setBorders(false);
tree.setSize("100%", "100%");
tree.setCheckStyle(CheckCascade.CHILDREN);
tree.setDisplayProperty("name");
tree.setIconProvider(iconProvider);
tree.setAutoLoad(true);


TreePanelDragSource source = new TreePanelDragSource(tree);
source.addDNDListener(new DNDListener() {
@Override
public void dragStart(DNDEvent e) {
BeanModel sel = tree.getSelectionModel().getSelectedItem();
if (sel.getBean() instanceof Document) {
e.setCancelled(true);
e.getStatus().setStatus(false);
return;
}
super.dragStart(e);
}
});

TreePanelDropTarget target = new TreePanelDropTarget(tree);
target.setAllowSelfAsSource(true);
target.setFeedback(Feedback.INSERT);
http://extjs.com/forum/attachment.php?attachmentid=14452&d=1245621356