Here is a jsFiddle of the broken functionality. Basically id the JSON type is numeric zero (0) the value is not exported. due to the check in the makeNode function I pointed out.
Can we please get a timeline on this fix. We are using a licensed version of the software in production and this is causing an issue for our users.
Hi Will,
Thank you for the catch, but unfortunately that did not fix the issue. It did however prompt me to look a bit more at my grid setup (we use the same setup on most pages) and after some trial and error I was able to isolate the issue to the autowidth : true setting, after removing it the pager buttons were centered correctly. I suspect there is bug somewhere as that setting should not cause the pager to not be centered but for us removing the setting it is an an acceptable solution.
Thanks for your help.
$ (“#reportTable”).jqGrid({
caption : “Fraud Report”,
colModel : columnModel,
autowidth : true,
datatype : ‘json’,
pager : “#reportTable-pager”,
viewrecords : true,
gridview : true,
headertitles : true,
altRows : false,
rowNum : 50,
loadonce : true,
scrollPopUp : true,
scrollLeftOffset : “83%”,
scroll : 1, // set the scroll property to 1 to enable paging with//
// <u>scrollbar</u> – virtual loading of records
emptyrecords : ‘Scroll to bottom to retrieve new page’,
gridComplete : function() {
if ($(“#reportTable”).jqGrid(‘getGridParam’, ‘datatype’) == “json”) {
$(“#reportTable”).setGridParam({
datatype : ‘local’
});
maximizeTable();
$(window).trigger(‘resize’);
}
},
grouping : true,
groupingView : {
groupField : [ “issuerPcrDescp”, “issuerBin” ],
groupColumnShow : [ false, false ],
groupText : [ “Issuer Pcr: <b>{0}</b> Fraud Total: <b>{fraudCount}<b>”, “Issuer Bin: <b>{0}</b>” ],
groupOrder : [ “asc”, “asc” ],
groupSummary : [ true, false ],
groupSummaryPos : [ ‘footer’, ‘footer’ ],
groupCollapse : false,
showSummaryOnHide : true
},
jsonReader : {
root : “listOfRecords”,
page : “currentPageIndex”,
total : “1”,
records : “totalItems”,
repeatitems : false,
cell : “cell”,
id : “id”,
userdata : “userdata”
}
});
jQuery(“#reportTable”).jqGrid(‘navGrid’, “#reportTable-pager”, {
edit : false,
add : false,
del : false,
search : false,
refresh : false
});
jQuery(“#reportTable”).jqGrid(‘navButtonAdd’, ‘#reportTable-pager’, {
caption : “”,
title : “Export Fraud Report data to Excel”,
id : “exportExcelButton”,
buttonicon : ‘ui-icon-print’,
onClickButton : function() {
$(‘#exportExcelButton’).addClass(‘ui-state-disabled’); // disable
$(“body”).css(“cursor”, “progress”);
setTimeout(function() {
$(“#reportTable”).jqGrid(“exportToExcel”, {
includeLabels : true,
includeGroupHeader : true,
includeFooter : true,
fileName : $(“#reportTable”).jqGrid(“getGridParam”, “caption”).replace(/\s+/g, ‘_’) + “_” + getTimestamp() + “.xlsx”,
maxlength : 50, // <u>maxlength</u> for visible string data
onBeforeExport : appendContextDataToExport,
replaceStr : replaceExportString
});
$(“body”).css(“cursor”, “default”);
$(‘#exportExcelButton’).removeClass(‘ui-state-disabled’); // enable
}, 30);
}
});
Hi Tony,
The issue is not that my value is not already a string but that the the export to excel code is treating my number as a ‘number’ instead of a string. Basically when the value in exported the cell is being marked as a ‘number’ cell instead of an ‘inlineStr’.
To fix this i propose the follow change update the regex check to insure values that are larger than the IEEE 15 digits are treated as strings as to not have them be truncated in the exported file.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top