Tema: Editar celda
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 26/01/2010, 21:42
hola123
 
Fecha de Ingreso: febrero-2009
Mensajes: 142
Antigüedad: 15 años, 10 meses
Puntos: 0
Respuesta: Editar celda

mi codigo es:


<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/styles.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery/jquery-1.3.2.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery/jquery.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery/jquery.jeditable.js"></script>
<script type="text/javascript" src="js/jquery/jquery.dataTables.js"></script>
<script type="text/javascript" src="js/searchBox.js"></script>
<script src="js/validation.js" type="text/javascript"></script>
<title> <%=title%> </title>
<script>
var oTable,oTable2;



$(document).ready(function() {

/* Apply the jEditable handlers to the table */
$('#datos tbody td').editable( 'saveAsistente', {
"callback": function( sValue, y ) {
var aPos = oTable2.fnGetPosition( this );
oTable2.fnUpdate( sValue, aPos[0], aPos[1] );
},
"height": "14px"
} );
/* Add a click handler to the rows - this could be used as a callback */
$('#datos tr').click( function() {
$(oTable.fnSettings().aoData).each(function (){
$(this.nTr).removeClass('row_selected');
});
$(this).addClass('row_selected');
} );


/* Init the table */
oTable = $('#datos').dataTable({
bPaginate: false
});


// maquillaSearchBox()

});

function fnShowHide( iCol )
{
var bVis = oTable.fnSettings().aoColumns[iCol].bVisible;
oTable.fnSetColumnVis( iCol, bVis ? false : true );
}




</script>



<style>
.row_selected {
background-color: #FF5555;
font-weight: bold;
color: #FF5555;
}
</style>
</head>
<body>
<div id="header">
<jsp:include page="/core/menu.jsp" />
<img src="images/logognp60.jpg" alt="logo" />
<hr class="topLine" />
</div>
<div id="leftcol" style="height: 600px;"></div>
<div id="rightcol"></div>
<div>

<div id="content">

<input type="hidden" id="idAsistenteSelec" />
<p> Evento: &quot; <s:property value="nomEvento" /> &quot; </p>
<p>

<s:form action="registro">
<s:select list="{}" label="Cena" id="selTipoRegistro" name="cenaID"
cssStyle="width: 300px" onchange="this.form.submit()">
<s:optgroup list="%{#{'0':'Registro al Evento'}}" label="Evento" />
<s:optgroup list="cenas" label="Cena" />
</s:select>


</s:form>

</p>

<a href="javascript:void(0);" onclick="fnShowHide(0);">ID<br></a>
<a href="javascript:void(0);" onclick="fnShowHide(1);">Ganador<br></a>
<a href="javascript:void(0);" onclick="fnShowHide(2);">Mesa<br></a>
<a href="javascript:void(0);" onclick="fnShowHide(3);">Nombre<br></a>
<a href="javascript:void(0);" onclick="fnShowHide(4);">Apellido Paterno<br></a>
<div style="overflow: scroll; height: 250px;">
<table border="0" align="center" id="datos">
<thead>
<tr>

<th class="bl">Nombre</th>
<th class="or">Ap Paterno</th>
<th class="bl">Ap Materno</th>
</tr>
</thead>
<tbody>
<s:iterator var="asistentes" value="asistentes">
<s:url var="urlGetAsistente" action="getAsistente" escapeAmp="false" namespace="/asistente" >
<s:param name="asistenteID" value="id_asistente"/>
<s:param name="redirectURL" value="%{'/asistente/registro'}" />
</s:url>
<tr id="<s:property value="id_asistente" />" onclick="javascript:updateDetails(this.id, 1)">



<td class="bl"> <s:property value="cv_nomasistente" /> </td>
<td class="or"> <s:property value="cv_apaterno" /> </td>
<td class="bl"> <s:property value="cv_amaterno" /> </td>
</tr>
</s:iterator>
</tbody>
</table>

</div>
<div id="contenedorDetalle" style="width:400px; margin:auto"></div>
</div>
</div>
<div id="footer">
<hr class="bottomFirstLine"/>
<hr class="bottomSecondLine" />
</div>
</body>
</html>

Última edición por hola123; 26/01/2010 a las 21:47