Forum


18:42

08/01/2010

Two grids $("#slist1") and $("#slist2") with pagers and rownumbers: true,
onSelectRow $("#slist1")
$("#slist2").jqGrid('setGridParam',{url:'04_programme/inscriptions/inscriptions_to_json.php?id_prog='+lastsel_prog}).trigger('reloadGrid');
The rownumbers of $("#slist1") stay OK (here : 1 to 3);
The rownumbers of $("#slist2") are negatives beginning with -9 to 0 for rowNum=10;
After a sort on $("#slist2") the rownumbers are OK : 1 to 10;
Any suggestions TONY ?
What a wonderful tool jQgrid is !
19:50

Moderators
30/10/2007

Hello,
Check you server response if it is correct for the second grid $("#slist2″). You can use firebug for this purpose.
Best 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.
23:22

08/01/2010

16:17

Moderators
30/10/2007

Hello,
Could you please post your grid configuration for the second grid and the response for it.
The best is if you provide a link to the problem
Best 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.
00:10

08/01/2010

The best is if you provide a link to the problem
The link is protected with password.
I omit to say that the problem is not permanent.
Here is the second grid configuration :
$("#slist2").jqGrid({
url:'04_programme/inscriptions/inscriptions_to_json.php?id_prog='+lastsel_prog,
datatype: "json",
mtype: "POST",
colNames:['id_inscription', 'id_adherent', 'nom', 'prenom', 'M…', 'Nom, prénom', 'Grp', 'id_ramassage', 'Ramassage', 'Licence', 'Modifiée le', 'Inscrit le', 'canceled'],
colModel:[
{name:'id_inscription',index:'id_inscription', width:35, stype: 'text', hidden:false, align:'right', search : true, sortable:true},
{name:'id_adherent',index:'id_adherent', width:30, stype: 'text', hidden:true, align:'right', search : false, sortable:false},
{name: 'nom', index:'nom', width:250, align:"left", hidden:true, searchoptions:{sopt:['bw','cn'], searchhidden: true}, sortable : false, search : true},
{name: 'prenom', index:'prenom', width:250, align:"left", hidden:true, sortable : false, search : false},
{name: 'politesse', index:'politesse', width:35, align:"right", sortable : false, search : false},
{name: 'nomprenom', index:'nomprenom', width:230, align:"left", sortable : true, search : false},
{name: 'groupe', index:'groupe', width:30, align:"center", sortable:false, search:false},
{name: 'id_ramassage', index:'id_ramassage', width:110, hidden:true, align:"left", sortable:false, search : false},
{name: 'ramassage_lib', index:'ramassage_lib', width:150, align:"left", sortable:true, search : false},
{name: 'licence', index:'licence', width:110, align:"left", formatter: 'licenceFmatter', hidden:false, search : true, sortable:true, searchoptions:{sopt:['bw','bn','eq'], responceInit:function(elem) { $(elem).val('3800');}}},
{name:'ts_updated',index:'ts_updated', width:80, stype: 'text', formatter: 'dateFmatterSQLString', hidden:true, search : false},
{name:'ts_inserted',index:'ts_inserted', width:80, stype: 'text', formatter: 'dateFmatterSQLString', hidden:false, search : false},
{name:'canceled',index:'canceled', width:80, align:"left", hidden:true, sortable:false, search : false}
],
pager: '#pagerGrid2',
rowNum:10,
rownumbers: true,
rownumWidth: 35,
gridview: true,
hiddengrid: false,
sortname: 'nomprenom',
sortorder: "asc",
sortable: true,
viewsortcols: [true,'vertical',true],
rowList:[10,20,30],
viewrecords: true,
recordtext : "inscrits {0} à {1} de {2}",//Enregistrements 1 - 8 sur 8
caption: "Aucune sélection",
width: "auto",
height: "100%",
multiselect: false,
toolbar: [false,"bottom"],
loadComplete : function(){
lastsel = undefined;
var title_prog = '“'+$("#slist1").jqGrid('getRowData',lastsel_prog).title_prog+'”';
var nRecords = $("#slist2").jqGrid('getGridParam','records');
$("#slist2").jqGrid('setCaption', text_SingPlurZero(nRecords, 'adhérent inscrit au programme n°' + lastsel_prog + ' ' + title_prog, 'adhérents inscrits au programme n°' + lastsel_prog + ' ' + title_prog , 'Aucun programme sélectionné') );
},
onSelectRow: function(id){
if( id != null ){
lastsel=id;
}
},
ondblClickRow: function(id){
//showPoint(id);
}
});
$("#slist2").jqGrid('navGrid','#pagerGrid2',
{
edit:true,
add:true,
del:false,
search:true,
view: false,
refresh:true
},
{},// edit options
{},// add options
{},// delete options
{
multipleSearch:true,
closeAfterSearch: true,
closeOnEscape:true,
groupOps: [ { op: "AND", text: "ET" }, { op: "OR", text: "OU" } ]
},// search options
{
caption: 'Voir la fiche',
modal: true,
jqModal:true,
width: 450,
closeOnEscape:true
}// view options
);
$("#slist2").jqGrid('navButtonAdd','#pagerGrid2',{caption:"Imprimer",
title: "Imprimer la liste des inscrits",
id: "imprimer_btn",
onClickButton:function(){
printList_inscrits(lastsel_prog);
//$('#dialog').dialog('open');
// $("#slist2").jqGrid('setPostresponce',{});
// $("#slist2").trigger("reloadGrid");
}
});
17:35

Moderators
30/10/2007

Hello,
Nothing strange here. Also when I say to look at the response I mean check what values you have aftre the first call only for those parameters: page, total, records - I think that some of these is not correct
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.
13:18

08/01/2010

Yes, Tony, you are right : the json responce get a page to 0.
I shall look why ?
{"page":"0","total":1,"records":"3","rows":[{"id":"27","cell":["27","156","ACCARD","St\u00e9phane","Mr","ACCARD, St\u00e9phane",null,null,null,"380020100057","2010-03-24","2010-03-24","0"]},{"id":"12","cell":["12","64","BARIBAUD","Line","Mme","BARIBAUD, Line",null,null,null,"380019961245","2010-03-20","2010-03-20","0"]},{"id":"11","cell":["11","1","LAFANECH\u00c8RE","Olivier","Mr","LAFANECH\u00c8RE, Olivier",null,null,null,"380020109012","2010-03-20","2010-03-20","0"]}]}
Most Users Ever Online: 715
Currently Online:
65 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