Forum
00:11
16/03/2010
After I called jqGridExport, the DND header does not match up with the data if I drag the header. Is this a bug or there's a work around for this?
here's my function:
$(
"#ExportMe").click(function() {
var s;
s = jQuery(
"#list1").jqGrid('jqGridExport', { exptype: 'xmlstring', root: 'grid', ident: '\t' });
});
11:25
Moderators
30/10/2007
Hello,
Which version is used?
Try with the latest one.
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:08
16/03/2010
I found out the cause for the header/column not match.
I have multiselect: true, which when I called jqGridExport
the actual colModel and colName was splice also. I highlight the code in purple.
Is there a way to duplicate the object instead of using the actual object?
jqGridExport: function(a){
a = b.extend({ exptype:
"xmlstring", root: "grid", ident: "\t" }, a || {}); var e = null; this.each(function() {
if (this.grid) {
var c = b.extend({}, b(this).jqGrid("getGridParam"));
if (c.rownumbers) { c.colNames.splice(0, 1); c.colModel.splice(0, 1) }
if (c.multiselect) {
c.colNames.splice(0, 1); c.colModel.splice(0, 1)
}
if (c.subgrid) {
c.colNames.splice(0,1); c.colModel.splice(0, 1)
}
if (c.treeGrid) for (var j in c.treeReader) { c.colNames.splice(c.colNames.length - 1); c.colModel.splice(c.colModel.length - 1) } switch (a.exptype) { case "xmlstring": e = "<" + a.root + ">" + xmlJsonClass.json2xml(c, a.ident) + "</" + a.root + ">"; break; case "jsonstring": e = "{" + xmlJsonClass.toJson(c, a.root, a.ident) + "}"; if (c.postData.filters != undefined) { e = e.replace(/filters":"/, 'filters":'); e = e.replace(/}]}"/, "}]}") } break }
}
});
return e
},
11:16
Moderators
30/10/2007
Hello,
This should not happen since of this,
var c = b.extend({}, b(this).jqGrid("getGridParam"));
but I will check it.
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.
22:59
05/05/2011
In order for it to work you should replace this:
var c = b.extend({}, b(this).jqGrid("getGridParam"));
With this:
var c = b.extend(true, {}, b(this).jqGrid("getGridParam"));
The difference is that the latter option makes a deep copy, instead of a shallow one.
May the power of the Ball-Of-Ham be with you...
Most Users Ever Online: 715
Currently Online:
26 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