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

		}
	}
	
	if ( !pageObj.buttonEventAfter['Insertar_Registro'] ) {
		pageObj.buttonEventAfter['Insertar_Registro'] = function( result, ctrl, pageObj, proxy, pageid, rowData, row, params ) {
			var ajax = ctrl;
/*var ctrl_My_Field= Runner.getControl(pageid, 'monto_saldo');
this.on('beforeSave', function(formObj, fieldControlsArr, pageObj){

if(ctrl_My_Field.getValue() >= 0){
return true;
}else{
 alert("Monto Acumulado Insuficiente !!!  Escoje otro  premio");
Runner.delDisabledClass ( pageObj.saveButton );
return false;
}
});




windows.location.reload();*/

/*
var message = result["txt"] + " - COMPLETE!";
ajax.setMessage(message);
location.reload();*/

swal ( "Realizado", "Los registros fueron insertados" , "success" );
		}
	}
	
	$('a[id="Insertar_Registro"]').each( function() {
		if ( $(this).closest('.gridRowAdd').length ) {
			return;
		}
		
		this.id = "Insertar_Registro" + "_" + Runner.genId();
		
		// create object
		var button_Insertar_Registro = new Runner.form.Button({
			id: this.id ,
			btnName: "Insertar_Registro"
		});
		
		// init
		button_Insertar_Registro.init( {args: [ pageObj, proxy, pageid ]} );
	});
};

