Delete items before show

Hi,

I have made a function for deleting items by user data value :

[code]tree.attachEvent("onXLE", function(id){
	var list = tree.getAllSubItems(0);
	var items = list.split(",");
	for(var i=0; i < items.length; i++){
	//alert(tree.getUserData(items[i],"VSB"));
		if (tree.getUserData(items[i],"VSB")=="No") {
			tree.deleteItem(items[i],true);
		};
	}
});[/code]

The problem is that: It’s loading tree and after it delete items.
I want to delete it before showing the tree.
Is it possible :question:
Thanks for you help!

Hi,

there is not onBeforeRender event in Tree. You may filter items on server and load xml without unnecessary nodes.

Ok, thank you for your help, i will try by this way.
Thanks