views:

1305

answers:

2

Almost everything is in the title ;)

When you create a TreePanel you can add a loader this way:

loader: new Ext.tree.TreeLoader({
  dataUrl: '../myurl.php'
});

But how to handle load errors?

For example if the user is not connected I want to display a Login box.

I can't find an example showing how to handle loading errors with TreeLoader and/or TreePanel.

+1  A: 

Try finding the answer here;

http://www.extjs.com/forum/showthread.php?t=2072

Eggie
Thank you very much this is a very very useful link I didn't find myself ;)
Olivier Pons
A: 

Okay I found the solution: listeners.

Here's my code, I hope this will help someone!

loader: new Ext.tree.TreeLoader({
    dataUrl: 'my_get_datas.php',
    listeners: {
        loadexception: function(tl, node, response) {
            if (response
            new WindowLoginPanel().show();
        }
    }
}),
Olivier Pons