Forum



19:39

04/01/2012

I'm initializing the grid like so:
$("#mainGrid").jqGrid({
url : g_MainGridUrl,
datatype : 'json',
height : 460,
autowidth : true,
colNames : g_ColNames,
colModel : g_ColModel,
pager : '#pager',
rowNum : 100,
rowList : [100, 200, 300],
sortname : g_DefaultSort,
sortorder : 'desc',
sortable: true,
viewrecords : true,
caption : 'Results',
hidegrid : false,
rownumbers : true,
jsonReader : {
root : "ROWS",
page : "PAGE",
total : "TOTAL",
records : "RECORDS",
cell : "",
id : g_DefaultSort
},
loadComplete: function(){
var num_records = $('#mainGrid').getGridParam('records');
$('#gview_mainGrid div.ui-jqgrid-titlebar span').html('Results: '+num_records);
},
loadBeforeSend : function(thisXhr) {
xhr = thisXhr;
},
ondblClickRow: function(rowid) {
jQuery(this).jqGrid('viewGridRow', rowid, { width: "500″});
}
});
$("#mainGrid").jqGrid('navGrid', '#pager', {
del : false,
add : false,
edit : false,
refresh:false,
search: false,
view: true
});
$("#mainGrid").jqGrid('navButtonAdd','#pager',{
caption: "Columns",
title: "Reorder Columns",
onClickButton : function (){
$("#mainGrid").jqGrid("columnChooser", {
done: function() {
resize_the_grid();
},
height: 320
});
}
});
and calling the grid like so, after building a filter Object:
$('#mainGrid').setGridParam({
url : g_MainGridUrl + Ext.util.JSON.encode(filter)
});
$('#mainGrid').trigger("reloadGrid");
As the subject states, when I double-click on a row to view its record and then change rows from the modal dialog, not all columns get updated – some do, but not others. I thought it might be because I didn't have <th>s defined for the table, so I tried adding them. I have downloaded the most recent version (4.2.0). Any ideas?
UPDATE: I think I've found the cause, but still don't have a solution. It seems that any column that has a title with a space in the name can't read the grid correctly. I confirmed by adding underscores to replace the spaces in the titles, and found that for each column corrected, its values began updating. I'm filing a bug report.
15:08

04/01/2012

Since Oleg has decided that column names can't include spaces if you want to use viewGridRow(), I decided to hack the function.
I added this line:
in two places; first between these two lines in function createData():
setme = false;
nm = this.name;
second, between these two lines in function fillData():
nm = obj.p.colModel[i].name;
// hidden fields are included in the form
Now, all ids are created with underscores in the place of spaces and all is well.
Most Users Ever Online: 715
Currently Online:
62 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