Runner.buttonEvents["recibo_cobro_pre"] = function( pageObj, proxy, pageid ) {
	//register a new button
	pageObj.buttonNames[ pageObj.buttonNames.length ] = 'recibo_cobro_pre';
	
	if ( !pageObj.buttonEventBefore['recibo_cobro_pre'] ) {
		pageObj.buttonEventBefore['recibo_cobro_pre'] = function( params, ctrl, pageObj, proxy, pageid, rowData, row, submit ) {		
			var ajax = ctrl;

		}
	}
	
	if ( !pageObj.buttonEventAfter['recibo_cobro_pre'] ) {
		pageObj.buttonEventAfter['recibo_cobro_pre'] = function( result, ctrl, pageObj, proxy, pageid, rowData, row, params ) {
			var ajax = ctrl;

var popup = Runner.displayPopup( {
 
url: "http://192.168.1.44:8082/jasperserver/flow.html?_flowId=viewReportFlow&standAlone=true&_flowId=viewReportFlow&ParentFolderUri=%2Freports%2Frosa&reportUnit=%2Freports%2Frosa%2Fnota_cobro&j_username=jasperadmin&j_password=jasperadmin&output=pdf&id_pdd="+result["id_derecho_Propietario"], 

width: 900,
  height: 620,
  header: 'Recibo de Cobro'
});

		}
	}
	
	$('a[id="recibo_cobro_pre"]').each( function() {
		if ( $(this).closest('.gridRowAdd').length ) {
			return;
		}
		
		this.id = "recibo_cobro_pre" + "_" + Runner.genId();
		
		// create object
		var button_recibo_cobro_pre = new Runner.form.Button({
			id: this.id ,
			btnName: "recibo_cobro_pre"
		});
		
		// init
		button_recibo_cobro_pre.init( {args: [ pageObj, proxy, pageid ]} );
	});
};

