Bonjour,
Le fichier html suivant reçoit depuis un script PHP le résultat d'une requête SQL au format XML et l'affiche dans un tableau :
Créer le LiveGrid est donc simple mais je rencontre un problème lorsque je veux mettre à jour le LiveGrid existant avec les données d'une autre requête SQL. J'ai essayé les méthodes clearRows et fetch en modifiant le dataSource du buffer mais sans succès. Je suis donc à la recherche du code qui va bien, si quelqu'un a une idée...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <title>Test AJAX : LiveGrid</title> <script type="text/javascript" src="rico2/src/rico.js"></script> <script src="rico2/src/ricoGridCommon.js" type="text/javascript"></script> <script src="rico2/src/ricoLiveGrid.js" type="text/javascript"></script> <script src="rico2/src/ricoLiveGridAjax.js" type="text/javascript"></script> </head> <body> <table id="cible"> <thead> <tr><th>login</th><th>Nom</th><th>Prénom</th></tr> </thead> </table> <script language="javascript"> Rico.loadModule('LiveGridAjax','LiveGridMenu','greenHdg.css'); var args=$H({req:'SELECT login,nom,prenom FROM compte;'}).toQueryString(); var params = { requestParameters:[args], }; var buffer = new Rico.Buffer.AjaxXML('php/xml_maker.php',params,{method:'post'}); var opts = { minPageRows:14, }; myGrid = new Rico.LiveGrid ('cible',buffer,opts); </script> </body> </html>
Cordialement,
Maxence
Partager