Board Logo

Most common errors setting up tree control
rock - 6/25/2004 at 09:59 AM

1. Unnecessary coma sign before closing brackets of items structure and template structure. The following sample represents such mistake:
--------------------------------
var TREE_ITEMS = [
['Test', 0, 0,
['Example']
], //This coma causes an IE error 'this.a_config.length is null or not an object'
];

var tree_tpl = {
....
'style_64':'t1ic', // mouseovered normal leaf caption style
'style_68':'t1ic', //This coma causes an IE error 'Expected identifier, string or number'
};
--------------------------------
2. Missed coma sign between items definitions or between settings of tree template. The following sample represents such mistake:
--------------------------------
var TREE_ITEMS = [
['Test', 0, 0,
['Example']// Missed coma causes incorrect tree representation.
['Example']
]
];
var tree_tpl = {
....
// icons - misc
'icon_e':'icons/empty.gif'// Missed coma causes an error 'Expected '}''
'icon_l':'icons/line.gif', // vertical line
....
};

--------------------------------
See also Tigra Tree Menu PRO debug utility


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/