[CLOSED] TreeColumn Locking gives error

  1. #1

    [CLOSED] TreeColumn Locking gives error

    I get an error when trying to lock the first column in a TreePanel like this:

    x.TreeColumn().Locked(true);
    Client side error:

    ext.axd?v=4.0.0-rc:132760 Uncaught TypeError: grid.addRelayers is not a function
    Last edited by fabricio.murta; Apr 22, 2016 at 5:18 PM. Reason: no user feedback for 7+ days
  2. #2
    Hello @sveins12!

    Would you mind wrapping code you paste between [code ] and [/code ] tags? We really appreciate it!

    Anyway, the code you provided makes no sense to me. Please try to provide samples with context, I have no idea what x is to you there.

    As for an example on how to lock the first column from code behind, assuming you have a TreeGrid with ID "tg1", that would be:

    During page load:
    tg1.ColumnModel.Columns.First().Locked = true;
    X.AddScript("App.tg1.lock(App.tg1.columns[0]);");
    But TreeColumns do not support locking/unlocking on the fly. The grid must be defined with them either already locked or unlocked. When locking is enabled to a TreeGrid, the TreeColumn in the set is locked by default. Unlocking the tree on a locked grid is also not supported.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thanks for showing me [code ] tags. I will use it.
    Last edited by sveins12; Apr 01, 2016 at 5:40 PM.
  4. #4
    Hello @sveins12!

    Try instead of setting Html.X().TreeColumn().Locked(true) setting the grid as lockable instead:
    Html.X().TreePanel().Lockable(true)

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  5. #5
    The exception also occurs when using EnableLocking(true).

    When tracing I see the following code inside Ext.tree.View - onRootChange is called twice:
    grid.addRelayers(newRoot);
    The first time the grid's id is "treepanel-1017-locked". This time the function addRelayers is defined.

    The second time the grid's id is "treepanel-1017-normal". This grid has not defined the function addRelayers, so this time the call fails.
  6. #6
    Hello @sveins12!

    I couldn't reproduce the error message you are receiving on my side. Can you share a test case where we can also see this error happening?
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] TreeColumn's Draggable set to true
    By RCN in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Mar 12, 2015, 5:24 PM
  2. [CLOSED] render treecolumn problem
    By hdsoso in forum 2.x Legacy Premium Help
    Replies: 18
    Last Post: Jul 17, 2013, 3:11 PM
  3. [CLOSED] TreePanel with more than one TreeColumn
    By RCN in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: May 11, 2012, 11:34 AM
  4. [CLOSED] [1.0] Locking Grid View JavaScript Error
    By jskibo in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 01, 2010, 11:09 PM
  5. Replies: 1
    Last Post: Dec 24, 2009, 3:36 AM

Posting Permissions