Xsn.RssElements.MainPanel = function(el) {
    Xsn.RssElements.MainPanel.superclass.constructor.call(this, el, {
	    loader: new Ext.tree.CheckTreeLoader({clearOnLoad:true, dataUrl:'index.php?action=getFeedContent'}),
        collapseFirst:false
    });

    this.setRootNode(new Ext.tree.CheckTreeNode({
	    text: 'Berichten', 
	    draggable:false, 
	    cls: 'folder',
	    id:'feed-root',
	    expanded:true,
	    selectable: false,
	    allowUncheckedParent:false,
	    uiProvider: Ext.tree.CheckTreeNodeUI
	}));

    this.on('check', function(node, checked){
    }, this);
	
	this.on('beforeclick', function(node){
		return false
	}, this);
	
	this.on('beforecollapse', function(node){
		if (this.root.id == node.id && node.isExpanded()) return false;
		return true;
	}, this);

	this.render();
};

Ext.extend(Xsn.RssElements.MainPanel, Ext.tree.CheckTreePanel, {

	loadFeed : function(url){
		this.getLoader().baseParams = {url:url};
		this.getLoader().load(this.root);
	}

});
