11
I’m using the property grouping
of jqGrid (4.6.0) with jQuery(1.11.0), but I could only generate the total per column and that’s not what I want, I would like the overall total.
jqGrid contains the property grouping
containing the footerrow
which would be the footnote row of the Grid (table). Does anyone know how to bring the totals in footerrow
?
The properties I’m using on Grid:
$("#respostaRelatorio").jqGrid({
url: urlRelatorio + "?" + dadosRelatorio,
colModel: modeloColunas,
mtype: "POST",
altRows: true,
datatype: "json",
loadonce: true,
height: "auto",
width: 1130,
rowNum: 10,
rowList: [ 10, 20, 30, 40, 50 ],
viewrecords: true,
pager: "#paginacao",
sortorder: "asc",
shrinkToFit: false,
headertitles: true,
loadui: "disable",
rownumbers: true,
autoencode: true,
caption: "Resultados encontrados",
deselectAfterSort: true,
gridview: true,
idPrefix: "id",
rowTotal: 4000,
sortable: true,
toppager: true,
resizable: true,
grouping: true,
groupingView: {
groupField: [ 'loginMedico' ],
groupCollapse: false,
groupOrder: [ 'asc' ],
groupSummary: [ true ],
groupDataSorted: true
},
footerrow: true,
userDataOnFooter: true
});
var modeloColunas = [
{ name: "loginMedico", index: "loginMedico", jsonmap: "loginMedico", label: "Login Médico", sortable: true, sorttype: "text", summaryType: "count", summaryTpl: "total" },
{ name: "nomeMedico", index: "nomeMedico", jsonmap: "nomeMedico", label: "Nome do Médico", sortable: true, sorttype: "text" },
{ name: "perfilMedico", index: "perfilMedico", jsonmap: "perfilMedico", label: "Perfil Médico", sortable: true, sorttype: "text"},
{ name: "tipoSolicitacao", index: "tipoSolicitacao", jsonmap: "tipoSolicitacao", label: "Tipo da Solicitação", sortable: true, sorttype: "text" },
{ name: "cancelada", index: "cancelada", jsonmap: "cancelada", label: "Cancelada", sortable: true, sorttype: "int" },
{ name: "liberada", index: "liberada", jsonmap: "liberada", label: "Liberada", sortable: true, sorttype: "int", summaryType: "sum" },
{ name: "negada", index: "negada", jsonmap: "negada", label: "Negada", sortable: true, sorttype: "int", summaryType: "sum" },
{ name: "pendente", index: "pendente", jsonmap: "pendente", label: "Pendente", sortable: true, sorttype: "int", summaryType: "sum" },
{ name: "total", index: "total", jsonmap: "total", label: "Total", sortable: true, sorttype: "int", summaryTpl: "total"} ];
The image of mine Grid, note that the footerrow
appears empty:
Put an example on jsfiddle that makes it easier to help you.
– Gabriel Gartz
William, as here as in SOE asked you for a full and functional example, I present to you jsfiddle.net, always seek to post a self-contained and complete example, including sample data to get better answers faster.
– Anthony Accioly
@Anthonyaccioly I use the jsfidlle.net tool, but it turns out that on this occasion there is no html page, making it not necessary to use jsfidle and what I do there would be basically what I passed to you here.
– Guilherme Vianna
You could create a functional example only with the
div
jqGrid in the HTML field and all Javascript code (including sample data, which is what was missing here), so it’s easier to play with your example and give you a functional response. The idea isn’t to push jsfiddle, just to help you get more answers (I don’t know if my answer solved your problem).– Anthony Accioly