Foros del Web » Programando para Internet » Jquery »

JQuery & MM_jumpMenu no funcionan

Estas en el tema de JQuery & MM_jumpMenu no funcionan en el foro de Jquery en Foros del Web. Hola a todos. Y Gracias por la ayuda de antemano Estoy tratando de hacer un combobox de JQuery que tenga en su evento onchange un ...
  #1 (permalink)  
Antiguo 06/08/2012, 12:24
Avatar de focesar  
Fecha de Ingreso: abril-2005
Mensajes: 84
Antigüedad: 19 años
Puntos: 0
Sonrisa JQuery & MM_jumpMenu no funcionan

Hola a todos. Y Gracias por la ayuda de antemano
Estoy tratando de hacer un combobox de JQuery que tenga en su evento onchange un Jump Menu.

Pero cada vez que incluyo en codigo del combo box de JQuery para el select OSTs deja de funcionar el JumpMenu, alguno sabe donde puedo editar el change para que ejecute todo?


Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="es-es">

<head>

<!-- metas -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-16">

<!-- titulo del sitio web -->
<title>SIGEA</title>

<!-- codigo para carga de los CSS -->
<link type="text/css" href="../default.css" rel="stylesheet">

<!--Carga JavaScript-->
<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.21.custom.min.js"></script>

<script type="text/JavaScript">
function MM_jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
</script>

<script type="text/javascript">
	(function( $ ) {
		$.widget( "ui.combobox", {
			_create: function() {
				var input,
					self = this,
					select = this.element.hide(),
					selected = select.children( ":selected" ),
					value = selected.val() ? selected.text() : "",
					wrapper = this.wrapper = $( "<span>" )
						.addClass( "ui-combobox" )
						.insertAfter( select );

				input = $( "<input>" )
					.appendTo( wrapper )
					.val( value )
					.addClass( "ui-state-default ui-combobox-input" )
					.autocomplete({
						delay: 0,
						minLength: 0,
						source: function( request, response ) {
							var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
							response( select.children( "option" ).map(function() {
								var text = $( this ).text();
								if ( this.value && ( !request.term || matcher.test(text) ) )
									return {
										label: text.replace(
											new RegExp(
												"(?![^&;]+;)(?!<[^<>]*)(" +
												$.ui.autocomplete.escapeRegex(request.term) +
												")(?![^<>]*>)(?![^&;]+;)", "gi"
											), "<strong>$1</strong>" ),
										value: text,
										option: this
									};
							}) );
						},
						select: function( event, ui ) {
							ui.item.option.selected = true;
							self._trigger( "selected", event, {
								item: ui.item.option
							});
						},
						change: function( event, ui  ) {
							if ( !ui.item ) {
								var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "$", "i" ),
									valid = false;
								select.children( "option" ).each(function() {
									if ( $( this ).text().match( matcher ) ) {
										this.selected = valid = true;
										return false;
										}
								});
								if ( !valid ) {
									// remove invalid value, as it didn't match anything
									$( this ).val( "" );
									select.val( "" );
									input.data( "autocomplete" ).term = "";
									return false;
								}
							}
						}
					})
					.addClass( "ui-widget ui-widget-content ui-corner-left" );

				input.data( "autocomplete" )._renderItem = function( ul, item ) {
					return $( "<li></li>" )
						.data( "item.autocomplete", item )
						.append( "<a>" + item.label + "</a>" )
						.appendTo( ul );
				};

				$( "<a>" )
					.attr( "tabIndex", -1 )
					.attr( "title", "Ver todos los items" )
					.appendTo( wrapper )
					.button({
						icons: {
							primary: "ui-icon-triangle-1-s"
						},
						text: false
					})
					.removeClass( "ui-corner-all" )
					.addClass( "ui-corner-right ui-combobox-toggle" )
					.click(function() {
						// close if already visible
						if ( input.autocomplete( "widget" ).is( ":visible" ) ) {
							input.autocomplete( "close" );
							return;
						}

						// work around a bug (likely same cause as #5265)
						$( this ).blur();

						// pass empty string as value to search for, displaying all results
						input.autocomplete( "search", "" );
						input.focus();
					});
			},

			destroy: function() {
				this.wrapper.remove();
				this.element.show();
				$.Widget.prototype.destroy.call( this );
			}
		});
	})( jQuery );

	$(function() {
		$( "#Tecnico" ).combobox();
		$( "#OSTs" ).combobox();
		
		$( "#toggle" ).click(function() {
		
			$( "#Tecnico" ).toggle();
			$( "#OSTs" ).toggle();
		});
	$(function() {
		});
	});
</script>

<style type="text/css">
	.ui-combobox {
		position: relative;
		display: inline-block;
	}
	.ui-combobox-toggle {
		position: absolute;
		top: 0;
		bottom: 0;
		margin-left: -1px;
		padding: 0;
		/* adjust styles for IE 6/7 */
		*height: 50px;
		*top: 0.1em;
	}
	.ui-combobox-input {
		margin: 0;
		padding: 0.3em;
	}
	</style>
	
</head>
<body>

<div id="main_asignar">
	<div>
	<h3 class="center"><span class="center">Asignación de Ordenes a Técnico</span></h3>

	<form name="frmAdd" method="post" action="ost_asignar_almacenado.asp">
	<fieldset>
	<legend></legend>
	<label for="OSTs">Cuantas OST desea asignar? : </label>
	<select id="OSTs" name="OSTs" onChange="MM_jumpMenu('self',this,0)">
	<% 
		Dim i , sel , line
		For i = 1 To 20
		If CInt(Request.QueryString("Line")) = i Then
			sel = "selected"
		Else
			sel = ""
		End IF
	%>
	<option value="<%=Request.ServerVariables("SCRIPT_NAME")%>?Line=<%=i%>"<%=sel%>><%=i%></option>
	<%
		Next
	%>
	</select>
	<br><br>
	<label for="Tecnico">Técnico al que desea asignar : </label>
	<select id="Tecnico" name="Tecnico"><option></option></select>
	<br><br>
<table width="480">
  <tr>
    <th> <div class="center">Central</div></th>
    <th> <div class="center">Orden</div></th>
    <th> <div class="center">Teléfono</div></th>
    <th> <div class="center">Movimiento</div></th>
    <th> <div class="center">Cita</div></th>
    <th> <div class="center">Venta</div></th>
  </tr>
  <%
  	line = Request.QueryString("line")
		IF line = "" Then
  			line = 1
		End IF
	For i = 1 To line
  %>
  <tr>
    <td><input type="text" name="txt-central<%=i%>" size="5"></td>
    <td><input type="text" name="txt-orden<%=i%>" size="10"></td>
    <td><input type="text" name="txt-telefono<%=i%>" size="10"></td>
    <td><input type="text" name="txt-movimiento<%=i%>" size="10"></td>
    <td><input type="text" name="txt-cita<%=i%>" size="10"></td>
    <td><input type="text" name="txt-venta<%=i%>" size="5"></td>
  </tr>
  <%
  Next
  %>
  </table>
  <input type="submit" name="submit" value="submit">
  <input type="hidden" name="hdnLine" value="<%=i-1%>">
</fieldset>
</form>
</div></div>

</body>

</html> 
__________________
El valor el hombre no es proporcional a las veces que ha triunfado, sino a las veces que se a levantado de los errores

:pensando:

Etiquetas: mm_jumpmenu
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:39.