-
Similar Content
-
By alysson122010
Galera estou começando a trabalhar com datatables porem tenho uma dificuldade pq tipo até 200 registros por pagina é aceitavel mas penso quando tiver 2000 registro carregar tudo numa pagina so da errado pq é muitos dados e pode travar tudo.
Como posso fazer para listar com limite por pagina ou alguma maneira para poder colocar varios dados sem travar.
estou usando assim:
<script type="text/javascript"> $(document).ready(function() { $('#example').DataTable({ "order": [[ 0, "desc" ]], "language": { "url": "//cdn.datatables.net/plug-ins/1.10.21/i18n/Portuguese-Brasil.json" } }); } ); </script> <table id="example" class="table table-striped table-bordered" style="width:100%"> <thead> <tr> <th>Name</th> <th>Position</th> <th>Office</th> <th>Age</th> <th>Start date</th> <th>Salary</th> </tr> </thead> <tbody> <tr> <td>Tiger Nixon</td> <td>System Architect</td> <td>Edinburgh</td> <td>61</td> <td>2011/04/25</td> <td>$320,800</td> </tr> <tr> <td>Garrett Winters</td> <td>Accountant</td> <td>Tokyo</td> <td>63</td> <td>2011/07/25</td> <td>$170,750</td> </tr> <tr> <td>Ashton Cox</td> <td>Junior Technical Author</td> <td>San Francisco</td> <td>66</td> <td>2009/01/12</td> <td>$86,000</td> </tr> <tr> <td>Cedric Kelly</td> <td>Senior Javascript Developer</td> <td>Edinburgh</td> <td>22</td> <td>2012/03/29</td> <td>$433,060</td> </tr> <tr> <td>Airi Satou</td> <td>Accountant</td> <td>Tokyo</td> <td>33</td> <td>2008/11/28</td> <td>$162,700</td> </tr> <tr> <td>Brielle Williamson</td> <td>Integration Specialist</td> <td>New York</td> <td>61</td> <td>2012/12/02</td> <td>$372,000</td> </tr> <tr> <td>Herrod Chandler</td> <td>Sales Assistant</td> <td>San Francisco</td> <td>59</td> <td>2012/08/06</td> <td>$137,500</td> </tr> <tr> <td>Rhona Davidson</td> <td>Integration Specialist</td> <td>Tokyo</td> <td>55</td> <td>2010/10/14</td> <td>$327,900</td> </tr> <tr> <td>Colleen Hurst</td> <td>Javascript Developer</td> <td>San Francisco</td> <td>39</td> <td>2009/09/15</td> <td>$205,500</td> </tr> </tbody> <tfoot> <tr> <th>Name</th> <th>Position</th> <th>Office</th> <th>Age</th> <th>Start date</th> <th>Salary</th> </tr> </tfoot> </table> <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script> <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.22/js/dataTables.bootstrap4.min.js"></script>
-
By lezão
Ola boa noite!
td bem com vcs?
Galera estou precisando de um codigo que quando der um certo horario tipo 10:00 hs da manhã o codigo mostra a div.
E as 16:00 hs o codigo OCULTA a div automaticamente.
Tenho um Codigo que faz isso, mas tem q clicar em um botão, vejam abaixo:
<script src="https://stacksnippets.net/scripts/snippet-javascript-console.min.js?v=1"></script> <div id="minhaDiv" style="display:none">Conteudo</div> <button type="button" onclick="Mudarestado('minhaDiv')">Mostrar / Esconder</button> <script type="text/javascript"> function Mudarestado(el) { var display = document.getElementById(el).style.display; if (display == "none") document.getElementById(el).style.display = 'block'; else document.getElementById(el).style.display = 'none'; } </script> obrigado!
-
By KaweAluno
Olá !!! Eu já consegui abrir um link em java no navegador , porém eu queria que o link abrisse dentro de uma JPainel ou dentro do JFrame . Alguém sabe ???
webView.zip (928,Bytes)
import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.BorderLayout; import javax.swing.border.BevelBorder; import java.awt.Color; import java.awt.Desktop; import javax.swing.JButton; import java.awt.event.ActionListener; import java.io.File; import java.io.IOException; import java.net.URI; import java.awt.event.ActionEvent; public class WebView { private JFrame frame; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { WebView window = new WebView(); window.frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. */ public WebView() { initialize(); } /** * Initialize the contents of the frame. */ private void initialize() { frame = new JFrame(); frame.setBounds(100, 100, 526, 422); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().setLayout(null); JPanel panel = new JPanel(); panel.setBorder(new BevelBorder(BevelBorder.LOWERED, Color.BLUE, Color.YELLOW, Color.BLACK, Color.RED)); panel.setBounds(0, 0, 518, 345); frame.getContentPane().add(panel); JButton btnNewButton = new JButton("Abrir web"); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { File link = new File("C:\\Users\\Adriano\\Desktop\\Gem Remoto\\Hinários\\hinário em mi.pdf"); Desktop.getDesktop().open(link); } catch (Exception e2) { // TODO: handle exception } } }); btnNewButton.setBounds(175, 361, 125, 23); frame.getContentPane().add(btnNewButton); } }
-
By ph1
boolean opcao = false; // tem que inicializar com true dentro do laço 'do-while' String resp; Scanner sc = new Scanner(System.in); do { // essas duas variáveis aqui podem ser declaradas dentro do while double media = 0, soma = 0; int j = 0; notas_aluno[j] = 0; for (int i = 0; i < nome_aluno.length; i++) { System.out.println("Insira o nome do aluno: "); nome_aluno[i] = sc.nextLine(); // usa sc.nextLine() //soma = 0; for (j = 0; j < notas_aluno.length; j++) // porque 4 ? usa o notas_aluno.length { System.out.println("Entre com a " + (j + 1) + " ª nota do aluno: " + (i + 1)); notas_aluno[j] = sc.nextDouble(); //notas_aluno[j] = Double.parseDouble(sc.nextLine()); // usa Double.parseDouble(sc.nextLine()) soma = soma + notas_aluno[j]; } media = soma / 5; // pq 5 ? usa o notas_aluno.length String aproveitamento = ""; if (media >= 9 && media <= 10) { aproveitamento = "A"; } else if (media >= 7.5 && media < 9) { // não precisa testar se é < 9 aproveitamento = "B"; } else if (media >= 6 && media < 7.5) { // não precisa testar se é < 7.5 aproveitamento = "C"; } else if (media >= 4 && media < 6) { // não precisa testar se é < 6 aproveitamento = "D"; } else if (media >= 0 && media < 4) { // não precisa testar se é < 4 aproveitamento = "E"; } System.out.println("Média: " + media); System.out.println("Conceito: " + aproveitamento); switch (aproveitamento) { case "A": case "B": case "C": System.out.println("APROVADO"); break; case "D": case "E": System.out.println("REPROVADO"); break; } System.out.print("Deseja Continuar? <s/n>: "); resp = sc.nextLine(); // usa sc.nextLine() if (resp.equalsIgnoreCase("n")) opcao = true; } }while (!opcao); String resp; boolean opcao = false; Scanner sc = new Scanner(System.in); do { System.out.print("Deseja Continuar? <s/n>: "); resp = sc.nextLine(); //} while (!opcao.equalsIgnoreCase(resp)); //while ( opcao != 'n'); // só pára se for == 'n' if(resp.equalsIgnoreCase("n")) { opcao = true; System.out.println("Saiu!"); //break; } }while(!opcao); ...> Prazer a todos. Interessante, seu eu tirar o código entre o d{ e a pergunta para sair, o while funciona perfeitamente, porém se eu retorno como o código para ler as notas e calcular o while não funciona para quando tiver menos de 50 alunos. Não consigo encontrar o erro. Obrigado.
-