[CLOSED] [#604] Tree node is selected when it's expanded

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] [#604] Tree node is selected when it's expanded

    On version 3.x, the behaviour of tree node has changed. At this version, the node is selected when it's expanded.

    On the following example, expand "Housewares" node. The node was selected
    https://examples3.ext.net/#/TreePane...nced/TreeGrid/

    On the same version 2.x example, expand "Housewares" node. The node was not selected
    https://examples3.ext.net/#/TreePane...nced/TreeGrid/

    My application performs some actions (Bind the record to the form, etc) when the node is selected, so i need to overcome the problem presented above.

    Thanks in advance.
    Last edited by Daniil; Jan 14, 2015 at 3:15 PM. Reason: [CLOSED]
  2. #2
    Hi Raphael,

    Thank you for the report. Created an Issue:
    https://github.com/extnet/Ext.NET/issues/604

    It is already reported to Sencha.
    http://www.sencha.com/forum/showthread.php?289477

    According to ExtJS 5.1.0 beta release notes, it has been fixed.
    http://cdn.sencha.com/ext/beta/ext-5...ase-notes.html

    So, it will be fixed in Ext.NET with the next upgrade of ExtJS.
  3. #3
    Thank you Daniil

    So, it will be fixed in Ext.NET with the next upgrade of ExtJS.
    Do you have any timeframe for upgrading ExtJs?
  4. #4
    We depend on Sencha here.

    Sencha released ExtJS 5.1.0 beta on November 27.
    http://www.sencha.com/forum/showthre...a-Is-Available!

    We would expect that ExtJS 5.1.0 final should be released already, but it is not. Unfortunately, Sencha doesn't provide any official time frames, but, I think, the final release should appear any day now. Once it is released, it will take a few weeks to incorporate it to Ext.NET.
  5. #5
    Thank you Daniil
  6. #6
    ExtJs 5.1.0 has just been released :)
  7. #7
    Aha:) Thank you for the information.

    We will probably release Ext.NET v3.0 final with ExtJS 5.0 very soon. Then we will start to incorporate ExtJS 5.1.
  8. #8
    Thank you Daniil. Please keep me posted.
  9. #9
    I was not able to overcome the issue presented on this thread by applying the fix suggested on: http://www.sencha.com/forum/showthread.php?284220. An exception is thrown.

    So i would like to suggest the following approach: Override Ext.grid.NavigationModel' onCellClick and validate if the event's target is the row expander, as shown below (Line 7):

    <!DOCTYPE html>
    <html>
    <head id="Head1" runat="server">
        <script type="text/javascript">
            Ext.override(Ext.grid.NavigationModel, {
                onCellClick: function (view, cell, cellIndex, record, row, recordIndex, clickEvent) {
                    if (Ext.isEmpty(clickEvent.target.className) || clickEvent.target.className.indexOf("expander") < 0) {
                        if (this.position.isEqual(clickEvent.position)) {
                            this.fireNavigateEvent(clickEvent);
                        } else {
                            this.setPosition(clickEvent.position, null, clickEvent);
                        }
                    }
                }
            });
        </script>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" ScriptMode="Debug" runat="server" />
        <ext:TreePanel RootVisible="false" Title="Ext.Net" Height="700" Width="500"
            Margin="10" Border="false" runat="server">
            <Store>
                <ext:TreeStore runat="server">
                    <Proxy>
                        <ext:AjaxProxy Url="/Example/LoadTreeFakeChildren">
                            <ActionMethods Read="POST" />
                            <Reader>
                                <ext:JsonReader RootProperty="data" />
                            </Reader>
                        </ext:AjaxProxy>
                    </Proxy>
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="Name" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:TreeStore>
            </Store>
            <Root>
                <ext:Node NodeID="0" Text="Root" />
            </Root>
            <ColumnModel>
                <Columns>
                    <ext:TreeColumn Text="Name" DataIndex="Name" Flex="2" runat="server" />
                </Columns>
            </ColumnModel>
        </ext:TreePanel>
    </body>
    </html>
    public class ExampleController : System.Web.Mvc.Controller
    {
        public ActionResult Index()
        {
            return View();
        }
        public StoreResult LoadTreeFakeChildren()
        {
            NodeCollection nodes = new NodeCollection(false);
    
            for (int index = 1; index < 6; index++)
            {
                Node node = new Node();
                node.NodeID = index.ToString() + DateTime.Now.Second;
                node.CustomAttributes.Add(new ConfigItem { Name = "Name", Value = node.NodeID, Mode = ParameterMode.Value });
                nodes.Add(node);
            }
    
            return new StoreResult { Data = nodes.ToJson() };
        }
    }


    Note: This is a temporary fix, since Sencha stated that it has been fixed on version 5.1.0, which will be incorporated to Ext.Net soon
    Last edited by RCN; Dec 16, 2014 at 6:31 PM.
  10. #10
    Thank you for sharing that, Raphael!

    As for ExtJS 5.1.0. Yes, we've already started to incorporate it.
    Last edited by Daniil; Jan 20, 2015 at 5:44 AM.
Page 1 of 2 12 LastLast

Similar Threads

  1. How to set a tree node selected ? v2.2
    By alucardg in forum 2.x Help
    Replies: 4
    Last Post: Oct 17, 2014, 8:57 AM
  2. Replies: 3
    Last Post: Jan 13, 2014, 2:51 PM
  3. [CLOSED] Save the Tree expanded Node state between sessions
    By Peter.Treier in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 02, 2013, 3:51 PM
  4. [CLOSED] how to add a child node to the selected tree node
    By hdsoso in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 18, 2013, 1:10 AM
  5. Selected Node - tree panel
    By filipator in forum 1.x Help
    Replies: 3
    Last Post: Mar 25, 2009, 2:58 PM

Posting Permissions