PDA

View Full Version : NS_ERROR_INVALID_POINTER in columnTree



CrazyHob
22 Dec 2010, 3:25 AM
Hello.

When tree component gets empty data set - then everything working just fine (no errors). But if there are some data - I'm getting this:

uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMHTMLDivElement.appendChild]" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: http://localhost:8080/js/ext/ext-all-debug-w-comments.js :: anonymous :: line 55730" data: no]

The problems lies in rendering it seems. At least it pops out right after render listener was called.

So here comes the question. Where can be the problem here?

mankz
22 Dec 2010, 11:38 AM
Post your code and the data used to populate your tree.

CrazyHob
23 Dec 2010, 12:51 AM
var tree = new Ext.tree.ColumnTree({
style:'background-color: #ffffff',
autoWidth: true,
autoHeight: true,
rootVisible:false,
autoScroll:true,
title: 'Task Groups',
columns:[
{
header:'Name<br>&nbsp;',
width:300,
dataIndex:'task'
},
{
header:'request<br>Number',
width:55,
dataIndex:'qnumber'
},
{
header:'Prior<br>&nbsp;',
width:24,
dataIndex:'pr'
},
{
header:'Comments<br>&nbsp;',
width:200,
dataIndex:'comment'
}
],
loader: new Ext.tree.TreeLoader({
//dataUrl:'js/column-data.json',
dataUrl: 'gettaskgrouptree.action',
uiProviders:{
'col': Ext.tree.ColumnNodeUI
},
listeners:{
'load': function(e){
("getexpandedtaskgroups.action",
{},
function(result, options )
{
var jsonData = Ext.util.JSON.decode(result.responseText);
var expanded = jsonData.expanded;
var exmas = expanded.split(",");
for(var i=0;i<exmas.length;i++){
if(exmas[i]!=""){
var node = tree.getNodeById(exmas[i]);
node.expand();
}
}
});
}
}
}),

root: new Ext.tree.AsyncTreeNode({
text:'Tasks',
expanded:true
}),
listeners: {
beforerender:function(e){
e.colmod = Ext.getCmp("hideThis").getValue();
},
expandnode: function(node){
if(node.attributes.iconCls=="task-folder")
{
postRequest("expandtaskgroup.action",
{
taskgroupid:node.attributes.id,
action:"expand"
},
function(result, options )
{});
}
},
collapsenode: function(node){
if(node.attributes.iconCls=="task-folder") {
postRequest("expandtaskgroup.action",
{
taskgroupid:node.attributes.id,
action:"collapse"
},
function(result, options )
{});
};
},
render: function(e){
// exception occures right after this action was called.
}

}
});


Here comes the JSON data:




[
{
"children":[],
"cls":"master-task",
"description":"dummy description of group1",
"iconCls":"task-folder",
"id":29834,
"leaf":true,
"name":"Test Group",
"uiProvider":"col"
},
{
"children":[],
"cls":"master-task",
"description":"dummy description of group2",
"iconCls":"task-folder",
"id":29835,
"leaf":true,
"name":"Some Test Group 2",
"uiProvider":"col"
}
]

CrazyHob
27 Dec 2010, 1:03 AM
The problem appeared right after transfering to 3rd version of extJS.
Now I'm using treeGrid and it's working just fine.


P.S. Mankz, thx for ur advice, it was unexpectedly helpful >_<.
P.P.S. You can Move/Clove/Delete this topic. It's not going to help anyone though >_<