$.ui.grid_form.subclass('ui.blog_post_grid_form', {

	submitHandler: function(responce) {
		this._super(responce);
		if (responce) {
			if (responce.result) {
				this.formBodyFieldSetContent.find('.body-input').val('');
			}
		}
	}
});
// Comments Grid
$.ui.grid.subclass('ui.blog_post_comment_grid', {
	
	createAddForm: function() {
		this.addForm = this.callAddForm({grid: this.grid, grid_widget: this.options.widget});
	}
	
});
/********* Player Page *********/
// Page
$.ui.page.subclass('ui.blog_post_page', {
	_init: function() {
		this.createCommentsGrid();
	}, 
	createCommentsGrid: function() {
		var config = {
			widget: 'blog_post_comment_grid', 
			addForm: $.extend({}, $.ui.grid.defaults.addForm, {widget: 'blog_post_grid_form'})
		};
		this.commentsGrid = this.getBodyObject('#blog_post_comment').blog_post_comment_grid(config);
	}
});
/********* Init *********/
$(document).ready(function() {
	$('.page').blog_post_page();
});