I'm developing an application where I use Jquery (1.11) with JqGrid (4.54) . This application has already been developed in ASP , where in your content there is a data totalizer per login along with the data displayed as a result in the table. I do not know if JqGrid would have to apply this line break to display the totals. Does anyone know tell me if it is possible or some other way to display these totals using JqGrid?
Below is the code table in ASP:
NexttothetableusingJqGrid:
and here is the Grid code:
var modeloColunas = [
{ name : "login", index : "login", label: "Login", sortable: true, sorttype: "text", jsonmap: "login" },
{ name : "nome", index : "nome", label: "Nome", sortable: true, sorttype: "text", jsonmap: "nome" },
{ name : "canal", index : "canal", label: "Canal", sortable: true, sorttype: "text", jsonmap: "canal" },
{ name : "tipoSolicitacao", index : "tipoSolicitacao", label: "Tipo Solicitação", sortable: true, sorttype: "text", jsonmap: "tipoSolicitacao" },
{ name : "totalAnalise", index : "totalAnalise", label: "Total Analise", sortable: true, sorttype: "int", jsonmap: "totalAnalise" },
{ name : "totalAtendimento", index : "totalAtendimento", label: "Total Atendimento", sortable: true, sorttype: "text", jsonmap: "totalAtendimento" },
{ name : "mediaAtendimento", index : "mediaAtendimento", label: "Média Atendimento", sortable: true, sorttype: "text", jsonmap: "mediaAtendimento" }];
var subGridHabilitado = true;
// We pass two parameters: subgrid_id is an id of the div tag created within a table. The row_id is the id of the row.
// If we want to pass additional parameters to the url we can use the method getRowData(row_id) - which returns associative array in type
// name-value here we can easy construct the following.
var gridInterno = function(subgrid_id, row_id) {
var rowData = $("#respostaRelatorio").jqGrid("getRowData", row_id);
var urlParametrosFormularioInterno = "?" + $("form .filtroRelatorioInterno").fieldSerialize() + "&filtro.tipoSolicitacao=" + retornaValorTipoSolicitacao(rowData.tipoSolicitacao) + "&filtro.login=" + rowData.login;
var subgrid_table_id = subgrid_id + "_t";
var idPaginacao = "#paginacaoSub" + row_id;
$("#" + subgrid_id).html("<table id=\"" + subgrid_table_id + "\" class=\"scroll\"></table><div id=\"paginacaoSub" + row_id + "\"></div>");
$("#" + subgrid_table_id).jqGrid({
url: urlRelatorioInterno + urlParametrosFormularioInterno,
colModel: [
{ name: "solicitacao", index: "solicitacao", jsonmap: "solicitacao", label: "Solicitação", sortable: true, sorttype: "int" },
{ name: "dataInicioAnalise", index: "dataInicioAnalise", jsonmap: "dataInicioAnalise", label: "Data Início da Análise", sortable: true, sorttype: "dataInicioAnalise", formatter: "date" },
{ name: "dataFinalAnalise", index: "dataFinalAnalise", jsonmap: "dataFinalAnalise", label: "Data Final da Análise", sortable: true, sorttype: "date", formatter: "date" },
{ name: "tipoAnalise", index: "tipoAnalise", jsonmap: "tipoAnalise", label: "Tipo Análise", sortable: true, sorttype: "text" },
{ name: "tempoAnalise", index: "tempoAnalise", jsonmap: "tempoAnalise", label: "Tempo Análise", sortable: true, sorttype: "text" },
{ name: "fila", index: "fila", jsonmap: "fila", label: "Fila", sortable: true, sorttype: "text" }],
pager: idPaginacao,
width: 1073,
height: "auto",
rowNum: 10,
rowList: [10, 20, 30, 40, 50],
loadonce: true,
beforeRequest: function() { $.blockUI(); },
gridComplete: function() { $.unblockUI(); }
}).jqGrid("navGrid", idPaginacao, { add: false, edit: false, del: false, search: false, refresh: false
}).jqGrid("navButtonAdd", idPaginacao, {
caption: "Exportar Excel",
onClickButton: function() {
$.blockUI();
$("#botaoExportarXLS").downloadArquivo(urlExportarExcelInterno, urlParametrosFormularioInterno.substring(1));
},
id: "botaoExportarXLS"
}).jqGrid("navButtonAdd", idPaginacao, {
caption: "Exportar PDF",
onClickButton: function() {
$.blockUI();
$("#botaoExportarPDF").downloadArquivo(urlExportarPdfInterno, urlParametrosFormularioInterno.substring(1));
},
id: "botaoExportarPDF"
});
};