Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/06/2010, 14:29
Avatar de Algadar
Algadar
 
Fecha de Ingreso: abril-2009
Mensajes: 115
Antigüedad: 15 años
Puntos: 1
Ayuda con el ActiveWidgets

Buenas Tardes,

Tengo la siguiente situación. Estoy utilizando el ActiveWidgets para crear grid los cuales se crean muy bien lo que deseo hacer es saber como meto un envento onkeypress para que al momento de darle enter alguna de las celdas rellene ejecute un evento x.

Te muestro el código que tengo.

Código HTML:
Ver original
  1. <style type="text/css">
  2.  
Código Javascript:
Ver original
  1. <script type="text/javascript">
  2.  
  3.  
  4.     var obj = new AW.UI.Grid;
  5. //  var obj = new AW.Grid.Extended;1
  6.  
  7.     obj.setSize(600, 250);
  8.     obj.setCellText(function(i, j){return j + "-" + i});
  9.     obj.setHeaderText("header");
  10.  
  11.     obj.setColumnCount(10);
  12.     obj.setRowCount(100);
  13.  
  14.     obj.setCellEditable(true);
  15.  
  16.     document.write(obj);
  17.  
  18.     obj.onRowAdded = function(row){
  19.         window.status = "Row added: " + row;
  20.         this.setCellText("new", 0, row);
  21.     }
  22.  
  23.     obj.onRowDeleting = function(row){
  24.         return !confirm("Delete row " + row + "?");
  25.     }
  26.  
  27.     obj.onRowDeleted = function(row){
  28.         window.status = "Row deleted: " + row;
  29.     }
  30.  
  31.  
  32.     // row index
  33.     var serial = 1000;
  34.  
  35.     function add(){
  36.         obj.addRow(serial++);
  37.     }
  38.  
  39.     function del(){
  40.         var i = obj.getCurrentRow();
  41.         obj.deleteRow(i);
  42.     }
  43.  
  44. </script>
Código HTML:
Ver original
  1. <br>
  2. <button onClick="add()">add row</button>
  3. <button onClick="del()">delete row</button>
  4. <form id="form1" name="form1" method="post" action="">
  5.   <p>
  6.     <label for="txt_cod_cli">Cliente</label>
  7.     <input type="text" name="txt_cod_cli" id="txt_cod_cli" />
  8.   </p>
  9.  
  10. </form>
  11. </body>
__________________
Deseo poco y lo poco que deseo, lo deseo poco.!
De Colores.

Última edición por Algadar; 21/06/2010 a las 14:49