salut a tous
je developpe actuellement dans le cadre un projet perso, une videotheque web.
j'utilise dojo 1.6 et je souhaite utiliser une grid pour afficher l'integralité de mes films.
j'ai consulté la doc et récupéré des éléments qui correspondent a ce que je cherche mais impossible de les mettre en interaction.
voila le code utilisé. c'est pompé depuis la doc du dojo.data.xmlstore que j'essaie d'adapter a mes besoins pour ensuite reprendre uniquement certains éléments et l'adapter a ce que je veux au final.
le fichier xml
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html dir="ltr"> <head> <style type="text/css"> body, html { font-family:helvetica,arial,sans-serif; font-size:90%; } </style> <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js" djConfig="parseOnLoad: true"> </script> <script> dojo.require("dojox.grid.DataGrid"); dojo.require("dojox.data.XmlStore"); var layoutBooks = [ [{ field: "titre", name: "Titre du Film", width: 10, formatter: function(item) { return item.toString(); } }, { field: "style", name: "Style", width: 10, formatter: function(item) { return item.toString(); } }, { field: "resume", name: "Resume", width: 'auto', formatter: function(item) { return item.toString(); } }, { field: "annee", name: "Annee", width: 10, formatter: function(item) { return item.toString(); } }, { field: "langue", name: "Langue", width: 10, formatter: function(item) { return item.toString(); } }]]; </script> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css" /> <style type="text/css"> @import "http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojox/grid/resources/Grid.css"; @import "http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojox/grid/resources/nihiloGrid.css"; .dojoxGrid table { margin: 0; } </style> </head> <body class=" claro "> <div dojoType="dojox.data.XmlStore" url="carnetMysqlToXml.xml" jsId="bookStore3" label="repertoire"> </div> <div id="grid" style="width: 400px; height: 300px;" dojoType="dojox.grid.DataGrid" store="bookStore3" structure="layoutBooks" query="{}" rowsPerPage="40"> </div> <!-- NOTE: the following script tag is not intended for usage in real world!! it is part of the CodeGlass and you should just remove it when you use the code --> <script type="text/javascript"> dojo.addOnLoad(function() { if (document.pub) { document.pub(); } }); </script> </body> </html>
au résultat, je n'ai aucun affichage. je pense que le probleme vient soit du store que j'utilise soit du layout , voire des 2.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 repertoire><film><titre>Star Wars: Episode IV - A New Hope</titre><style>SCIENCEFICTION</style><resume>Luke Skywalker leaves his home planet, teams up with other rebels, and tries to save Princess Leia from the evil clutches of Darth Vader.</resume><sortie>1977</sortie><langue>ANGLAIS</langue></film><film><titre>Oui, mais...</titre><style>FICTION</style><resume>Attracted but also frightened by her sexuality, a teenage girl undergoes a brief therapy with a warm, humorous and competent psychotherapist.</resume><sortie>2001</sortie><langue>FRANCAIS</langue></film><film><titre>Placard, Le</titre><style>COMEDIE</style><resume>François Pignon, un homme au costume sombre et à l'allure discrète, est comptable dans une usine de caoutchouc, dont le secteur privilégié est le préservatif. Il est sur le point d'être licencié, lorsque sur les conseils de Belon, son voisin d'immeuble, il propage la rumeur selon laquelle il est homosexuel. Suite à ce faux coming out, les cadres de la direction décident de garder Pignon pour des raisons "politiquement correctes". Celui-ci passe brusquement pour un marginal, bien qu'il n'ait rien changé à son comportement. C'est le regard des autres qui va s'en trouvé modifié.</resume><sortie>2001</sortie><langue>FRANCAIS</langue></film><film><titre>Star Wars: Episode V - The Empire Strikes Back</titre><style>SCIENCEFICTION</style><resume>While Luke takes advanced Jedi training from Yoda, his friends are relentlessly pursued by Darth Vader as part of his plan to capture Luke.</resume><sortie>1980</sortie><langue>ANGLAIS</langue></film><film><titre>Choristes, Les</titre><style>DRAME</style><resume>The new teacher at a severely administered boys' boarding school works to positively effect the students' lives through music.</resume><sortie>2004</sortie><langue>FRANCAIS</langue></film><film><titre>Dans la peau de John Malkovich</titre><style>FICTION</style><resume>Craig, a puppeteer, takes a filing job in a low-ceilinged office in Manhattan. Although married to the slightly askew Lotte, he hits on a colleague, the sexually frank Maxine. She's bored but snaps awake when he finds a portal leading inside John Malkovich: for 15 minutes you see, hear, and feel whatever JM is doing, then you fall out by the New Jersey Turnpike. Maxine makes it commercial, selling trips for $200; also, she's more interested in Lotte than in Craig, but only when Lotte is inside JM. JM finds out what's going on and tries to stop it, but Craig sees the portal as his road to Maxine and to success as a puppeteer. Meanwhile, Lotte discovers others interested in the portal. </resume><sortie>1999</sortie><langue>ANGLAIS</langue></film><film><titre>How to Lose a Guy in 10 Days</titre><style>COMEDIE</style><resume>Benjamin Barry is an advertising executive and ladies' man who, to win a big campaign, bets that he can make a woman fall in love with him in 10 days. Andie Anderson covers the 'How To' beat for 'Composure' magazine and is assigned to write an article on 'How to Lose a Guy in 10 days.' They meet in a bar shortly after the bet is made.</resume><sortie>2003</sortie><langue>ANGLAIS</langue></film><film><titre>Bladerunner</titre><style>SCIENCEFICTION</style><resume>Deckard, a blade runner, has to track down and terminate 4 replicants who hijacked a ship in space and have returned to earth seeking their maker.</resume><sortie>1982</sortie><langue>ANGLAIS</langue></film><film><titre>Alien</titre><style>SCIENCEFICTION</style><resume>A mining ship, investigating a suspected SOS, lands on a distant planet. The crew discovers some strange creatures and investigates.</resume><sortie>1979</sortie><langue>ANGLAIS</langue></film><film><titre>mon film </titre><style>FICTION</style><resume>le meilleur</resume><sortie>2011</sortie><langue>FRANCAIS</langue></film><film><titre>Black Swan</titre><style>DRAME</style><resume>A ballet dancer wins the lead in 'Swan Lake' and is perfect for the role of the delicate White Swan - Princess Odette - but slowly loses her mind as she becomes more and more like Odile, the Black Swan. </resume><sortie>2010</sortie><langue>ANGLAIS</langue></film><film><titre>Star Wars: Episode VI - Return of the Jedi</titre><style>SCIENCEFICTION</style><resume>After rescuing Han Solo from the palace of Jabba the Hutt, the Rebels attempt to destroy the Second Death Star, while Luke Skywalker tries to bring his father back to the Light Side of the Force. </resume><sortie>1983</sortie><langue>ANGLAIS</langue></film></repertoire>
si quelqu'un pouvait m'aiguiller, ca serait vraiment super.
merci a tous![]()






Répondre avec citation


Partager