Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-6656 in 4.1.4.
  1. #1
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    975
    Vote Rating
    110
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default [4.1.1 rc2] TreePanel/TreeStore: returning false from beforeload causes issues

    [4.1.1 rc2] TreePanel/TreeStore: returning false from beforeload causes issues


    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.1.1 rc2
    Browser versions tested against:
    • Any
    Description:
    • The initial requirement is preveting a node expanding on some condition. I have tried to return false from "beforeitemexpand", it doesn't work well. Then I have noticed this behavior is not documented. I mean the behavior on returning false. Is there a lack in the docs or, really, there is no such feature?
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.tree.Panel-event-beforeitemexpand
    • Then I have tried to return false from the beforeload listener and have faced three issues:
    1. The loading icon doesn't dissappear.
    2. All nodes become not expandable. It doesn't happen due to returning false for the beforeload, because:
    3. The beforeload event appears to be not fired anymore.
    • Since the returning false feature from the beforeload listener is documented, I would consider the issues above a bug.
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.tree.Panel-event-beforeload
    • The same happens for both - tree and treestore - beforeload events.
    • Is there any other way to optionally prevent expanding? For a static tree as well, because beforeload looks to be not an option for a static tree.
    Steps to reproduce the problem:
    • Run the page
    • Expand the "Node1".
    • Try to expand other nodes.
    The result that was expected:
    • The nodes are not expandable due to returning false from the beforeload listener.
    • The loading icon should disappear or even just not shown.
    The result that occurs instead:
    • When I try to expand the first node - it's not expanded. Good.
    • Its loading icon is shown. Bad.
    • All nodes become not expandable. It doesn't happen due to returning false for the beforeload, because the beforeload listener is not fired anymore.
    Test Case:
    • The example does not require a working URL for AJAX proxy to reproduce the issues.
    Code:
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>TreePanel/TreeStore BeforeLoad Bug</title>
    
        <link type="text/css" rel="stylesheet" href="../resources/css/ext-all.css" />
        
        <script type="text/javascript" src="../ext-all.js"></script>
    
        <script type="text/javascript">
            Ext.onReady(function () {
                Ext.create("Ext.tree.Panel", {
                    renderTo: Ext.getBody(),
                    height: 300,
                    width: 300,
                    store: {
                        type: "tree",
                        proxy: {
                            type: "ajax",
                            url: "/Test/GetNodes"
                        },
                        listeners: {
                            beforeload: {
                                fn: function (store, operation) {
                                    console.log("beforeload");
                                    return false;
                                }
                            }
                        }
                    },
                    root: {
                        expanded: true,
                        text: "Root",
                        children: [{
                            text: "Node1"
                        }, {
                            text: "Node2"
                        }, {
                            text: "Node3"
                        }]
                    }
                });
            });
        </script>
    </head>
    <body>
    
    </body>
    </html>



    HELPFUL INFORMATION


    Debugging already done:
    • Apologize, no time for now.
    Possible fix:
    • Calling
      Code:
      operation.node.set('loading', false);
      hides the loading icon. But, I think, it should not be done manually. Anyways, the beforeload event stays to be not fireable.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    975
    Vote Rating
    110
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Hi Mitchell,

    Hope you are doing well.

    Could you kindly inform is there any time frame for this issue?
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  4. #4
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    975
    Vote Rating
    110
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

Thread Participants: 1