Forum
07:56
13/11/2008
Hi,
I have to click 2 times to get the grid refreshed after having clicked on button "Relancer la recherche avec les dates indiquées ci-dessous"...
The new 'url' is updated, as seen with the alert displayed on gridComplete but the 'old' datas remain on the grid ...
Any idea ?
(by the way, the new 'caption' and 'loadtexte' are not showing) ...
Thanks in advance, Tony
### code hereunder ####
jQuery("#list19").jqGrid(
{
url:"xmlmap_serveur.php",
datatype: "xml",
colNames:["Intitulé","Ville","Date"],
colModel:[
{name:"intitule", index:"Intitule", width:220, xmlmap:"intitule"},
{name:"ville", index:"Ville", width:150, xmlmap:"ville>intituleVille"},
{name:"date1", index:"date1", width:90, xmlmap:"dateValiditeDebut"}
],
height:250,
viewrecords: true,
loadonce: false,
loadtext: "charentes-info.com récupères les données que vous avez demandé ...",
xmlReader:
{
root:'details',
row:'detail',
repeatitems:false
},
caption: "Liste des manifestations trouvées par charentes-info",
sortname: "date",
onSelectRow: function(id){$.showAkModal("xmlmap_produit.php?id="+id,"",870,500);},
gridComplete: function(){alert(jQuery("#list19").getGridParam("url"));}
})
.navGrid('#pager',{edit:false,add:false,del:false, refresh:false, search:false})
.navButtonAdd('#pager',
{caption:"Relancer la recherche avec les dates indiquées ci-dessous",
onClickButton:function()
{requette();}
}
);
function requette()
{
debut=document.formulaire.debut.value;
fin=document.formulaire.fin.value;
jQuery("#list19").setGridParam({caption:"new_caption_here"}).trigger("reloadGrid");
jQuery("#list19").setGridParam({loadtext:"new_loadtext_here"}).trigger("reloadGrid");
jQuery("#list19").setGridParam({url:"xmlmap_serveur.php?debut="+debut+"&fin="+fin}).trigger("reloadGrid");
//alert(jQuery("#list19").getGridParam("url"));
}
03:38
Moderators
30/10/2007
Hello,
You call 3 time trigger reload grid - this of course IMHO is bad idea, since
there is unknown which trigger will finish first. To work this:
function requette()
{
debut=document.formulaire.debut.value;
fin=document.formulaire.fin.value;
jQuery(”#list19?).setGridParam({caption:”new_caption_here”,
loadtext:”new_loadtext_here”,
url:”xmlmap_serveur.php?debut=”+debut+”&fin=”+fin
}).trigger(”reloadGrid”);
}
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
49 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66