View Full Version : [CLOSED] [#315] Exception is thrown when expanding a tree node after inserting a column into TreePanel

Aug 05, 2013, 1:53 PM
Few days ago i opened a thread regarding the best way to add a column into a TreePanel: http://forums.ext.net/showthread.php?25801-CLOSED-which-is-the-best-way-to-add-a-column-into-a-TreePanel. The approach given by the thread works as expected, but at this time, i am facing an issue when expanding an item, after adding a column into the TreePanel.

On the example below, press Insert Column button, then expand any item of the TreePanel.


An exception is thrown at ItemAdd method



<!DOCTYPE html>
<head id="Head1" runat="server">
<script type="text/javascript">
var insertColumn = function () {
App.TreePanel1.insertColumn(1, Ext.create('Ext.grid.column.CommandColumn', {
xtype: "commandcolumn",
text: '',
width: 23,
sortable: false,
hideable: false,
resizable: false,
draggable: false,
commands: [{
xtype: "button",
command: "Command",
iconCls: "#BulletCross",
tooltip: {
text: ""
}), true);
<ext:ResourceManager runat="server" />
<ext:Button Text="Insert Column" runat="server">
<Click Handler="insertColumn();" />
<%--Tree Panel--%>
<ext:TreePanel ID="TreePanel1" RootVisible="false" Title="Ext.Net" Height="700" Width="500"
Margins="10" Border="false" runat="server">
<ext:TreeStore runat="server">
<ext:AjaxProxy Url="/Example/LoadTreeFakeChildren">
<ActionMethods Read="POST" />
<ext:JsonReader Root="data" />
<ext:Model runat="server">
<ext:ModelField Name="Task" />
<ext:ModelField Name="Column1" />
<ext:Node NodeID="0" Text="Root" />
<ext:TreeColumn Text="Task" Lockable="true" DataIndex="Task" Flex="2" runat="server" />
<ext:Column Text="Column1" Lockable="true" DataIndex="Column1" runat="server" />


using System;
using System.Web.Mvc;
using Ext.Net;
using Ext.Net.MVC;

namespace SandBox.Controllers
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 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 });

return new StoreResult { Data = nodes.ToJson() };

Any ideas to overcome this issue?

Aug 05, 2013, 2:40 PM
Hi Raphael,

Please take the note of the bottom of this post into consideration.

As for a CommandColumn in a TreePanel, please do not forget that it works with OverOnly="true" only.

Does it not work with overOnly: true?

Aug 05, 2013, 5:03 PM
I am wrong. A CommandColumn without OverOnly="true" should work in a TreePanel. So, we are investigating.

Aug 05, 2013, 5:18 PM
Thank you Daniil. Please keep me posted.

Aug 06, 2013, 3:54 AM
There is a bug in ExtJS. A TreeView doesn't pass nodes into its itemadd listener. Reported to Sencha.

It has been fixed for CommandColumn and ComponentColumn in SVN trunk.

Thank you for the report!

Aug 06, 2013, 11:45 AM
Thank you Daniil. I will retest.

Aug 06, 2013, 12:23 PM
Once again, thank you Daniil. Please mark this thread as closed.

Jan 29, 2015, 4:01 PM
I think that this thread should be closed but it's still open.

I was not able to test whether it's resolved on version 3.1.0 because there is an issue related to inserting a command column into grid http://forums.ext.net/showthread.php?52381-Insert-command-column-into-grid.

I will review this thread when issue related to inserting a command column into grid is resolved.

Jan 30, 2015, 6:37 AM
Thanks for the review!

I think that this thread should be closed but it's still open.

It was left open, because it was fixed in Ext.NET for CommandColumn and ComponentColumn only, but the original ExtJS bug was not fixed. Now I retested with pure ExtJS 5.1.0 and the issue is fixed. So, marking closed.

I was not able to test whether it's resolved on version 3.1.0 because there is an issue related to inserting a command column into grid http://forums.ext.net/showthread.php?52381-Insert-command-column-into-grid

This issue has been fixed as well.

Jan 30, 2015, 11:46 AM
I confirm that it has been fixed.