GeneXus - incluir funciones javascript en mi masterpage para verlo en toda mi aplicacion genexus

 
Vista:
Imágen de perfil de Osmel

incluir funciones javascript en mi masterpage para verlo en toda mi aplicacion genexus

Publicado por Osmel (10 intervenciones) el 29/08/2017 23:01:23
buenas tardes colegas del foro, trabajo con genexus evol 3 version 10, hice unas funciones jquery para cambiarle el color a los mensajes de genexus que se muestran en el ErrorViewer, para los mensajes con E* se muestren en rojo, los mensajes con M* se muestren en amarillo y los mensajes de confirmacion en verde, deseo poder incluir estas funciones en genexus en mi masterpage para que me salga en toda mi aplicacion. por favor necesito su ayuda es algo urgente, probe con el usercontrol boostrapAlert esta mi bueno pero necesito que los mensajes se oculten cuando me posicione en un elemento o cuando introdusca una nueva informacion. Saludos aca le dejo el codigo Js

codigo JS:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$(document).ready(function () {
    $('input[title="Confirmar"]').click( function () {
 
 
		$('#gxErrorViewer > div').each(function (index, value){
 
			var text = $(this).text();
 
			console.log(text);
 
			if (text.indexOf("E*") != -1){
				$(this).attr("class", "alert alert-danger");
			} else if (text.indexOf("Los") != -1){
				$(this).attr("class", "alert alert-success");
			}
			if (text.indexOf("M*") != -1){
				$(this).attr("class", "alert alert-warning");
			}
			if (text.indexOf("Finalizado") != -1){
				$(this).attr("class", "alert alert-success");
			}
			if (text.indexOf("ejec") != -1){
				$(this).attr("class", "alert alert-warning");
			}
			if (text.indexOf("existe") != -1){
				$(this).attr("class", "alert alert-danger");
			}
			if (text.indexOf("fuera") != -1){
				$(this).attr("class", "alert alert-danger");
			}
	    });
 
    });
 
    $("input").change(function(){
		if  ($("#gxErrorViewer").children().length > 0) {
 
			$("#gxErrorViewer").fadeOut(5000);
 
		}
	});
 
});

en el masterpage de genexus puse un textblock lo nombre ScriptJS con propiedad format html y en el evento estar puse lo siguiente

1
2
3
4
5
6
7
8
9
10
ScriptJS.Caption += '<script type="text/javascript">'
ScriptJS.Caption +=    '$(document).ready(function(){'
ScriptJS.Caption +=    		'$("input").change(function(){'
ScriptJS.Caption +=    			'if  ($("#gxErrorViewer").children().length > 0) {'
/ScriptJS.Caption +=    			      '$("#gxErrorViewer").fadeOut(5000);'
/ScriptJS.Caption +=    			'}'
/ScriptJS.Caption +=    		'});'
/ScriptJS.Caption +=    	'});'
/ScriptJS.Caption += '</script>'
Endevent
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder