Advertisement
Guest User

Untitled

a guest
Jan 14th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. function Listar(){
  2. $("#tblListar").html("");
  3. $("#tblListar").html( "<thead>"+ " <tr>"+ "<th>Usuário</th>"+ " <th>Rota</th>"+ " <th>Cliente</th>"+ " <th>Hora</th>"+ " </tr>"+ "</thead>"+ "<tbody>"+ "</tbody>" );
  4. var read_transition = db.transaction("tbPos", "readonly");
  5. var store = read_transition.objectStore("tbPos");
  6. var rows = store.openCursor()
  7. rows.onsuccess = function(evt){
  8. var cursor = evt.target.result;
  9. if(cursor)
  10. {
  11.  
  12. $("#tblListar tbody").append("<tr>");
  13. $("#tblListar tbody").append("<td>"+cursor.value.usuario+"</td>");
  14. $("#tblListar tbody").append("<td>"+cursor.value.rota+"</td>");
  15. $("#tblListar tbody").append("<td>"+cursor.value.cliente+"</td>");
  16. $("#tblListar tbody").append("<td>"+Date(cursor.value.hora*1000)+"</td>");
  17. $("#tblListar tbody").append("</tr>");
  18.  
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement