Bonjour,
Je n'ai jamais dans ma vie réussi à partir une liste JQGrid fonctionnelle de zéro même si j'ai déjà travaillé sur des intégrations existantes. Encore cette fois, rien ne se passe et je fait pourtant à la lettre ce qui se retrouve sur la doc en ligne que j'ai trouvé. Quelqu'un peut me dire ce qui ne fonctionne pas?
Version JQuery : 1.5.2
Version JQgrid : 4.0.0
Code JQuery
String JSon retournée par mon script PHP
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 //Liste JQGrid var JQGlist = $("<table>"); $(JQGlist).addClass(".JQGlist"); $(".module").append(JQGlist); var JQGpager = $("<div>"); $(JQGpager).addClass(".JQGpager"); $(".module").append(JQGpager); $(JQGlist).jqGrid({ url:"jx.php?vmod="+nom_module+"&vfunc=get_JQGlist&page=1&rows=100&sidx=id_production&sord=asc", datatype: "json", colNames:['Production','Début production', 'Client', 'Amount','Tax','Total','Notes'], colModel:[ {name:'id_production',index:'id_production', width:110}, {name:'debut_production',index:'debut_production', width:140}, {name:'name',index:'name asc, invdate', width:100}, {name:'amount',index:'amount', width:80, align:"right"}, {name:'tax',index:'tax', width:80, align:"right"}, {name:'total',index:'total', width:80,align:"right"}, {name:'note',index:'note', width:150, sortable:false} ], rowNum:10, rowList:[10,20,30], pager: '.JQGpager', sortname: 'id', viewrecords: true, sortorder: "desc", caption:"JSON Example" }); jQuery(JQGlist).jqGrid("navGrid",".JQGpager",{edit:false,add:false,del:false});
Code : Sélectionner tout - Visualiser dans une fenêtre à part {"page":"1","total":1,"records":13,"rows":[{"id":"VP11030015","cell":["VP11030015","0000-00-00 00:00:00",0,0,0,0,0]},{"id":"VP11030018","cell":["VP11030018","0000-00-00 00:00:00",0,0,0,0,0]},{"id":"VP11030025","cell":["VP11030025","0000-00-00 00:00:00",0,0,0,0,0]},{"id":"VP11040001","cell":["VP11040001","0000-00-00 00:00:00",0,0,0,0,0]},{"id":"VP11040004","cell":["VP11040004","0000-00-00 00:00:00",0,0,0,0,0]},{"id":"VP11040005","cell":["VP11040005","0000-00-00 00:00:00",0,0,0,0,0]},{"id":"VP11040008","cell":["VP11040008","0000-00-00 00:00:00",0,0,0,0,0]},{"id":"VP11040009","cell":["VP11040009","0000-00-00 00:00:00",0,0,0,0,0]},{"id":"VP11040010","cell":["VP11040010","0000-00-00 00:00:00",0,0,0,0,0]},{"id":"VP11040012","cell":["VP11040012","0000-00-00 00:00:00",0,0,0,0,0]},{"id":"VP11040013","cell":["VP11040013","0000-00-00 00:00:00",0,0,0,0,0]},{"id":"VP11040014","cell":["VP11040014","0000-00-00 00:00:00",0,0,0,0,0]},{"id":"VP11040015","cell":["VP11040015","0000-00-00 00:00:00",0,0,0,0,0]}]}
Partager