Forum


16:30

07/06/2009

Hi !
I want use the summary footer (laste version of jqgrid 3.5 build 5) with server-side php (xml format) but userdata for the summary footer are not in my grid, only the footer table !
somebody can help me ??
—-
$(document).ready(function() {
//Premier Tableau : Consultation des déclarations
$('#list').jqGrid({
url:'../library/Request/recordsdeclaration.php?id=<?php echo $this->escape($this->iduser);?>',
datatype: 'xml',
colNames:['Annee', 'Date','Heure debut','Heure Fin','Nbre Heures','Taches','Projets','Saisie le','Statut', 'Motif refus','PDF'],
colModel :[ {name:'annee_hs', index:'annee_hs', width:70, align: 'center',
editable:true,
editoptions:{readonly:true}
},
{name:'date_hs', index:'date_hs', width:100, formatter:'date', align: 'center',
editable:true,
editoptions:{readonly:true}
},
{name:'heure_d_hs', index:'heure_d_hs', width:90, align: 'center',
editable:true,
editoptions:{readonly:true}
},
{name:'heure_f_hs', index:'heure_f_hs', width:90, align: 'center',
editable:true,
editoptions:{readonly:true}
},
{name:'nbre_heure_hs', index:'nbre_heure_hs', width:90, align: 'center',
editable:true,
editoptions:{readonly:true}
},
{name:'tache', index:'tache', width:90, align: 'center',
editable:true,
hidden:true,
editrules:{edithidden:true},
editoptions:{readonly:true}
},
{name:'projet', index:'projet', width:90, align: 'center',
editable:true,
hidden:true,
editrules:{edithidden:true},
editoptions:{readonly:true}
},
{name:'date_avis_hs', index:'date_avis_hs', formatter:'date', width:90, align:'center',
editable:true,
editoptions:{readonly:true}
},
{name:'etat_avis_hs', index:'etat_avis_hs', width:90, align:'center',
editable:true,
editoptions:{readonly:true}
},
{name:'motif_refus_hs', index:'motif_refus_hs', width:320, align: 'center',
editable:true,
hidden:true,
editrules:{edithidden:true},
editoptions:{readonly:true}
},
{name:'PDF', index:'PDF', width:60, align:'center'}],
pager: $('#pager'),
rowNum:10,
width:920,
height:250,
sortname: 'id_avis_hs',
sortorder: “desc”,
viewrecords: true,
caption: '',
footerrow : true,
userDataOnFooter : true
});
—–
echo “<?xml version='1.0' encoding='utf-8'?>”;
echo “<rows>”;
echo “<page>”.$page.”</page>”;
echo “<total>”.$total_pages.”</total>”;
echo “<records>”.$count.”</records>”;
// be sure to put text data in CDATA
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
echo “<row id='”. $row[id_avis_hs].”'>”;
echo “<cell>”. $row[annee_hs].”</cell>”;
echo “<cell>”. $row[date_hs].”</cell>”;
echo “<cell>”. $row[heure_d_hs].”</cell>”;
echo “<cell>”. $row[heure_f_hs].”</cell>”;
echo “<cell>”. $row[nbre_heure_hs].”</cell>”;
echo “<cell>”. $row[tache].”</cell>”;
echo “<cell>”. $row[projet].”</cell>”;
echo “<cell>”. $row[date_avis_hs].”</cell>”;
echo “<cell>”. $row[etat_avis_hs].”</cell>”;
echo “<cell>”. $row[motif_refus_hs].”</cell>”;
echo “<cell><![CDATA[<a href='../library/TCPDF/examples/example_003.php?num=".$row[user_id_hs].”&&date=”.$row[date_avis_hs].”' target='_blank'><img src='../public/images/PDF_20.png' alt='PDF' style='border:0;' /></a>]]></cell>”;
$ntotalhs = $row[nbre_total_hs];
echo “</row>”;
}
echo “<userData>”;
echo “<heure_f_hs>”. 'Total :' .”</heure_f_hs>”;
echo “<nbre_heure_hs>”. $ntotalhs .”</nbre_heure_hs>”;
echo “</userData>”;
echo “</rows>”;
15:25

16/06/2009

You will need to add the summary row data as user data in the following format.
Note: XML for adjacent tree node plus summary row
<?xml version='1.0' encoding='utf-8'?>
<rows>
<page>1</page>
<total>1</total>
<records>27</records>
<userdata name="aaaa">total</userdata> # name = target column's name
<userdata name="bbbb">1b2b3b</userdata>
<userdata name="cccc">1c2c3c</userdata>
<userdata name="dddd">1d2d3d</userdata>
<row>
<cell>1</cell> # row id
<cell>1a</cell> # expanding column
<cell>1b</cell> # column 2
<cell>1c</cell> # column 3
<cell>1d</cell> # column 4
<cell>0</cell> # node level 0
<cell>NULL</cell> # parent row id
<cell>false</cell> # is this a leaf?
<cell>false</cell> # expand?
</row>
<row>
<cell>2</cell> # row id
<cell>2a</cell> # expanding col
<cell>2b</cell> # column 2
<cell>2c</cell> # column 3
<cell>2d</cell> # column 4
<cell>0</cell> # node level 1
<cell>1</cell> # parent row id
<cell>true</cell> # is this a leaf?
<cell>false</cell> # expand?
</row>
<row>
<cell>3</cell> # row id
<cell>3a</cell> # expanding col
<cell>3b</cell> # column 2
<cell>3c</cell> # column 3
<cell>3d</cell> # column 4
<cell>0</cell> # node level 1
<cell>1</cell> # parent row id
<cell>true</cell> # is this a leaf?
<cell>false</cell> # expand?
</row>
</rows>
Most Users Ever Online: 715
Currently Online:
53 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