1. #1
    Sencha Premium Member
    Join Date
    Mar 2007
    Posts
    12
    Vote Rating
    0
    Nick is on a distinguished road

      0  

    Default Help TreePanel, TreeLoader Error Handling (.40 alpha)

    Help TreePanel, TreeLoader Error Handling (.40 alpha)


    Yui-ext users,

    In the case of loading tree nodes asynchronously, do you have examples of how you're handling errors?

    1. I would like to have a timeout in the case where the server is taking too long to respond. However, it looks like
    YAHOO.ext.tree.TreeLoader : requestData() doesn't provide a way to specify a timeout. (other than modifying code?)

    2. I've attached a "loadexception" listener (which gets called just fine in the case of an error), but how do I get the node back to is original (unexpanded) state,
    so that a user could try again? What I'd like to do-- is set a CSS class on the node that failed (a folder icon with a red star on it) to indicate
    node has not loaded. User can click on this node to try again.

    3. On the node itself, I'd like to provide a tooltip. A <span title="some text"> for the n.text , would be just fine. Is there a way to do this without modifying
    the var buf = [' ... code in the render() function?
    3a. I see there is some qtip (quick tip) support, but I'm not sure how to utilize it, or if this would work on dynamically loaded tree nodes.

    Code or suggestions on the above-- ways to handle (server) errors in TreeLoader would be appreciated.

    Thank you,
    Nick

  2. #2
    Ext User
    Join Date
    Mar 2007
    Posts
    1
    Vote Rating
    0
    insaned is on a distinguished road

      0  

    Default


    Hi Nick,

    Here is my workaround for 2)

    Code:
    treePanelLoader.on('loadexception', function(treePanel, node, response) {
    
    	Ext.MessageBox.alert(
    		document.title,
    		Data.Strings.ErrorLoaderException);
    
    	window.setTimeout(function() {
    
    		node.collapse(false, false);
    
    		while(node.firstChild){
    
    			node.removeChild(node.firstChild);
    		}
    
    		node.childrenRendered = false;
    		node.loaded = false;
    
    		node.ui.updateExpandIcon();
    
    	}, 250);
    });
    "load" is fired after "loadexception". In Jack's "load" handler there is a call to expand(...). Using window.setTimeout(...) allows you to invoke the callback after the "load" handler has finished executing.

    Jack, is it possible to have "loadException" fired after the "load" event or at least a way to disable the call to expand(...) if there was a loadException? Perhaps a new event "loadFailed"? Thank you.

    Hope this helps.

  3. #3
    Ext User
    Join Date
    Sep 2010
    Posts
    1
    Vote Rating
    0
    bluestone0324 is on a distinguished road

      0  

    Default


    It work! Thanks.

Similar Threads

  1. TreePanel and JSON TreeLoader Problem (new nodes invisible)
    By sjanes71 in forum Ext 2.x: Help & Discussion
    Replies: 32
    Last Post: 11 May 2007, 6:55 AM
  2. [Alpha 3 Rev 4] ComboBox Error
    By prophet in forum Ext 1.x: Bugs
    Replies: 2
    Last Post: 27 Mar 2007, 3:18 PM
  3. data.Store error handling
    By tryanDLS in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 27 Feb 2007, 8:13 AM
  4. Alpha 2 treepanel rootVisible:false bug
    By pomata in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 26 Feb 2007, 9:47 AM
  5. JSONDataModel.loadData error handling
    By tryanDLS in forum Ext 1.x: Bugs
    Replies: 12
    Last Post: 30 Nov 2006, 4:45 PM

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar