Ext.namespace("Ext.hansub.board");

Ext.hansub.board.BoardContentWrapperPanel = function(parent,config) {
		
	this.parent = parent;
	this.config = config;

	
	this.boardContentPanel = new Ext.hansub.board.BoardContentPanel(
									this.parent,
									{
										
										id:"BoardContent_"+this.config.id,
										parentID : "BoardContentWrapper_"+this.config.id,
										border:false,
										defaults: {autoScroll:true},
										split: true,
										region:'center',
										//autoWidth:true,
										autoHeight:true
										//width:100						
									}
								);
	

	this.commentGridPanel = new Ext.hansub.panel.InlineBlog({
		
		id:'inlineBlog_board_'+this.config.id,
		border:false,
		title:'게시판',
		camping_user_uid : '',
		camping_list_uid : '',
		board_uid : this.config.id,
		autorefrash:false,
		region:'center',
		closable:false,
		fieldWidth : 500,
		inputdisable : false,
		isBoard:'yes'
		
	});	

	/**
    this.commentGridPanel = new Ext.ux.hansub.board.CommentGridPanel({
				//title: "댓글 목록",
				id: "CommentGridPanel_"+this.config.id,
				region:'east',
				//width:300,	
				//autoHeight:100,
				//autoWidth:true,
				autoHeight:true,
				closable:false,
				loadMask: {msg:'댓글화면 구성 중'},
				//defaults: {autoScroll:true},
				split: true,
				collapsible: true,
				collapseMode: "mini",
				hideCollapseTool:true,
		        border:false,
				istoolbar:true,

		        hideHeaders:true
			});

    	**/
   
			
	Ext.hansub.board.BoardContentWrapperPanel.superclass.constructor.call(this, {
		id:"BoardContentWrapper_"+this.config.id,
		title:this.config.title,
		//layout:'border',
		closable:true,
		border:false,
    	//padding: 10,
    	
      	defaults: {autoScroll:true},
		//border:true,
		items:[this.boardContentPanel,this.commentGridPanel]
        
	});
	//this.on('render', this.init, this);
	
	//this.commentGridPanel.on('render',function(){this.add(this.commentGridPanel);},this);
	
	
	/**
	this.on('afterlayout', this.init, this);
	this.on('activate', this.initLayout, this);
	this.on('close', this.closed, this);
	
	this.on('render',this.loginState,this);
   **/
};

Ext.extend(Ext.hansub.board.BoardContentWrapperPanel, Ext.Panel, {
	
	init : function(){
		//Ext.getCmp('layout').doLayout();
		//this.add(this.commentGridPanel);
	},
	
	reload : function(){
		this.boardContentPanel.reload();
		this.parent.reload();
	},
	
	setContent:function(data){
		
		this.boardContentPanel.setContent({
			uid:data.uid
		});
		this.commentGridPanel.setTitle(" ");
		/**
		this.commentGridPanel.setData({
				dbtable_uid:data.uid,
				dbtable:'camping_board'
		});
		**/
	}
	
});

