[OPEN] [#250] TreePanel fails when EnableLocking is set to true

  1. #1

    [OPEN] [#250] TreePanel fails when EnableLocking is set to true

    When i try to use Locking functionality (set EnableLocking to true) on TreePanel i get the following error:

    Click image for larger version. 

Name:	Error001.png 
Views:	15 
Size:	19.8 KB 
ID:	6280

    Any ideas to overcome this issue?

    <!DOCTYPE html>
    <html>
    <head id="Head1" runat="server">
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:TreePanel ID="_tpnl" RootVisible="false" EnableLocking="true" Title="Ext.Net" Height="700" Width="500"
            Margins="10" Border="false" runat="server">
            <Store>
                <ext:TreeStore ID="TreeStore1" runat="server">
                    <Proxy>
                        <ext:AjaxProxy Url="/Example/LoadFakeChildren">
                            <ActionMethods Read="POST" />
                            <Reader>
                                <ext:JsonReader Root="data" />
                            </Reader>
                        </ext:AjaxProxy>
                    </Proxy>
                    <Model>
                        <ext:Model ID="Model1" runat="server">
                            <Fields>
                                <ext:ModelField Name="Task" />
                                <ext:ModelField Name="Column1" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:TreeStore>
            </Store>
            <Root>
                <ext:Node NodeID="0" Text="Root" />
            </Root>
            <ColumnModel>
                <Columns>
                    <ext:TreeColumn ID="TreeColumn2" Text="Task" Lockable="true" DataIndex="Task" Flex="2" runat="server" />
                    <ext:Column ID="TreeColumn3" Text="Column1" Lockable="true" DataIndex="Column1" runat="server" />
                </Columns>
            </ColumnModel>
        </ext:TreePanel>
    </body>
    </html>
    namespace SandBox.Controllers
    {
        public class ExampleController : System.Web.Mvc.Controller
        {
            public ActionResult Index()
            {
                return View();
            }
    
            public StoreResult LoadFakeChildren()
            {
                NodeCollection nodes = new NodeCollection(false);
    
                for (int index = 1; index < 6; index++)
                {
                    Node no = new Node();
                    no.NodeID = index.ToString() + DateTime.Now.Second;
                    no.CustomAttributes.Add(new ConfigItem { Name = "Task", Value = no.NodeID, Mode = ParameterMode.Value });
                    no.CustomAttributes.Add(new ConfigItem { Name = "Column1", Value = Guid.NewGuid().ToString(), Mode = ParameterMode.Value });
                    nodes.Add(no);
                }
    
                return new StoreResult { Data = nodes.ToJson() };
            }
        }
    }
    Thanks in advance.
    Last edited by Daniil; May 29, 2013 at 3:46 AM. Reason: [OPEN] [#250]
  2. #2
    Hi Raphael,

    Thank you for the report. I reported to Sencha.
    http://www.sencha.com/forum/showthread.php?264678

    Possible fix
    Ext.tree.Panel.override({
        getChecked: function() {
            var view = this.getView();
    
            if (view.lockedView) {
                view = view.lockedView;
            }
    
            return view.getChecked();
        }    
    });
  3. #3
    Thank you Daniil, let's gonna wait for a permanent fix.
  4. #4
    I committed the fix to the SVN trunk.

    Also, created an Issue.
    https://github.com/extnet/Ext.NET/issues/250

    We will remove our fix if Sencha fixes it itself.
  5. #5
    Thank you Daniil
  6. #6
    No error is thrown on version 3.1.0. Daniil, is the workaround still present on version 3.1.0?
  7. #7
    Yes, it is still not fixed in ExtJS 5.1.0 and our fix is still required.

    Thank you for the update! I wrote a note in the Issue.
  8. #8
    Thank you Daniil
  9. #9
    Should this thread be moved to Bugs area?

Similar Threads

  1. [CLOSED] how can i set TreePanel TreeColumn locked=true
    By UT007 in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: May 17, 2013, 3:32 PM
  2. Replies: 5
    Last Post: Apr 26, 2013, 1:05 PM
  3. Replies: 11
    Last Post: Apr 04, 2013, 4:49 AM
  4. Replies: 3
    Last Post: Dec 11, 2012, 5:45 AM
  5. Replies: 0
    Last Post: May 04, 2010, 7:08 AM

Posting Permissions