Forum


22:19

27/07/2009

I just attempted to upgrade my dev environment from jqGrid 3.6.4 to 3.6.5, and found that the new version results in no rows being displayed on any of my grids. There are no errors being returned by jqGrid; the grid and its associated pager are simply blank. I'm returning the data to the grid in a JSON format, if that makes any difference.
Has the format the grid is expecting back for JSON records changed?
For now, I have simply reverted back to 3.6.4, and everything appears to be working as well as always.
Thanks,
Matt
10:33

06/05/2010

I know it's no help to you, but I've got the same issue upgrading from 3.6.2 to 3.6.5. Also using JSON. No data displayed.
There's clearly a serious breaking change somewhere!
This is my code that works beautifully in 3.6.2 (it's requesting the data correctly and getting exactly the same JSON data that works with 3.6.2):
jQuery(document).ready(function() {
var mygrid = $('#list').jqGrid({
ajaxGridOptions: { contentType: "application/json; charset=utf-8″ },
serializeGridData: function(postdata) {
postdata.contract_number = $.query.get("contract_number");
postdata.product_serial_number = $.query.get("product_serial_number");
postdata.conman_customer_id = $.query.get("conman_customer_id");
postdata.oracle_customer_number = $.query.get("oracle_customer_number");
postdata.coverage_template = $.query.get("coverage_template");
postdata.contract_origin = $.query.get("contract_origin");
postdata.status = $.query.get("status");
postdata.not_status = $.query.get("not_status");
postdata.tsslog_customer_id = $.query.get("tsslog_customer_id");
if (postdata._search == false) {
postdata.searchField = $.query.get("searchfield");
postdata.searchString = $.query.get("searchstring");
postdata.searchOper = $.query.get("searchoper");
}
if (postdata.filters == null) { postdata.filters = "";}
return JSON.stringify(postdata);
},
url: "webservices/contracts.asmx/contractlist",
datatype: "json",
mtype: "POST", // don't know why this is needed here and not on ajaxGridOptions like contentType
onSelectRow: function(ids) {
getdetaildata(ids); //version that gets the data from the web service, including data from joined tables (comments and entitlements)
//showDetailsFromjqGridRow(ids); //version that extracts the data from the grid row, avoiding the need for another data pull
},
colNames: [
'id',
'Contract',
'Line',
'Eff',
'Ver',
'Status',
'Start',
'End',
'Cov Template',
'Serv Part No',
'Product',
'Prod Part No',
'Serial No',
'Description',
'Term reason',
'Term date',
'Contract_origin',
'Renewal date',
'import_status',
'conman_cust_id',
'Created',
'Updated',
'Contact_name',
'Contact_email',
'Contact_role',
'Level',
'Cust contacts',
'3rd pty contacts',
'bill_to_num',
'bill_to_name',
'bill_to_addr',
'ship_to_num',
'ship_to_name',
'ship_to_addr',
'other_num',
'other_name',
'other_addr'
],
colModel: [
{ name: 'id', index: 'id', width: 15, hidden: true },
{ name: 'contract_number', index: 'contract_number', width: 80, hidden: false },
{ name: 'line_number', index: 'line_number', hidden: true, width: 30, align: "center" },
{ name: 'effectivity_number', index: 'effectivity_number', hidden: true, width: 30, align: "center" },
{ name: 'version_number', index: 'version_number', hidden: true, width: 30, align: "center" },
{ name: 'status', index: 'status', width: 70, hidden: false },
{ name: 'start_date', index: 'start_date', width: 55, hidden: false },
{ name: 'end_date', index: 'end_date', width: 55, hidden: false },
{ name: 'coverage_template', index: 'coverage_template', width: 100, hidden: false },
{ name: 'service_part_number', index: 'service_part_number', width: 80, hidden: true },
{ name: 'product_description', index: 'product_description', width: 100, hidden: false },
{ name: 'product_part_number', index: 'product_part_number', width: 80, hidden: false },
{ name: 'product_serial_number', index: 'product_serial_number', width: 100, hidden: false },
{ name: 'contract_description', index: 'contract_description', width: 100, hidden: true },
{ name: 'termination_reason', index: 'termination_reason', width: 100, hidden: true },
{ name: 'terminated_date', index: 'termination_date', width: 65, hidden: true },
{ name: 'contract_origin', index: 'contract_origin', width: 80, hidden: true },
{ name: 'renewal_date', index: 'renewal_date', width: 55, hidden: true },
{ name: 'import_status', index: 'import_status', width: 65, hidden: true },
{ name: 'conman_customer_id', index: 'conman_customer_id', width: 65, hidden: true },
{ name: 'created_date', index: 'created_date', width: 55, hidden: true },
{ name: 'updated_date', index: 'updated_date', width: 55, hidden: true },
{ name: 'contact_name', index: 'contact_name', width: 65, hidden: true },
{ name: 'contact_email', index: 'contact_email', width: 65, hidden: true },
{ name: 'contact_role', index: 'contact_role', width: 65, hidden: true },
{ name: 'level', index: 'level', width: 65, hidden: true },
{ name: 'customer_contacts', index: 'customer_contacts', width: 65, hidden: true },
{ name: 'third_party_contacts', index: 'third_party_contacts', width: 65, hidden: true },
{ name: 'bill_to_customer_number', index: 'bill_to_customer_number', width: 60, hidden: true },
{ name: 'bill_to_customer_name', index: 'bill_to_customer_name', width: 100, hidden: true },
{ name: 'bill_to_customer_address', index: 'bill_to_customer_address', width: 100, hidden: true },
{ name: 'ship_to_customer_number', index: 'ship_to_customer_number', width: 60, hidden: true },
{ name: 'ship_to_customer_name', index: 'ship_to_customer_name', width: 100, hidden: true },
{ name: 'ship_to_customer_address', index: 'ship_to_customer_address', width: 100, hidden: true },
{ name: 'thirdparty_customer_number', index: 'thirdparty_customer_number', width: 60, hidden: true },
{ name: 'thirdparty_customer_name', index: 'thirdparty_customer_name', width: 100, hidden: true },
{ name: 'thirdparty_customer_address', index: 'thirdparty_customer_address', width: 100, hidden: true }
],
pager: "#pager",
rowList: [10, 20, 30, 50, 100],
sortable: true, // can drag and drop columns
gridview: true, // faster to load, less functionality
caption: 'Contracts',
loadError: function (xhr, st, err) {
jQuery("#rsperror").html(st + " " + xhr.status + " " + xhr.statusText);
},
loadComplete: function (xhr) {
jQuery("#rsperror").html("");
},
editurl: "contracts.asmx/edit1″,
width: 775,
height: 475
});
jQuery("#list").jqGrid('navGrid', '#pager', { edit: false, add: false, del: false, refresh: false, search: false },
{}, // edit options
{}, // add options
{}, // del options,
{}, // refresh options
{} // search options – not active – using multiple search defined below
);
jQuery("#list").jqGrid('gridResize', {});
jQuery("#list").jqGrid('navButtonAdd', '#pager', {
buttonicon: "ui-icon-calculator",
caption: "", title: "Select columns",
onClickButton: function() { jQuery("#list").jqGrid('columnChooser'); }
});
jQuery("#list").jqGrid('navButtonAdd', '#pager', {
buttonicon: "ui-icon-search",
caption: "", title: "Search",
onClickButton: function() { jQuery("#list").jqGrid('searchGrid', { multipleSearch: true }); }
});
});
function getdetaildata(myid) {
var mynewid = $("#list").getCell(myid,'id');
$.ajax({
type: "POST",
url: "webservices/contracts.asmx/contractrecord",
data: "{id: " + mynewid + "}",
contentType: "application/json; charset=utf-8″,
dataType: "json",
success: function(msg) {
showdata(msg);
}
});
}
13:02

Moderators
30/10/2007

Hello,
@Inara - I'm not sure what is going with this, but if you send me a link to the problem I maybe can help.
Also which version of jQuery is used?
Best 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.
20:41

27/07/2009

@Tony: I'm using jQuery v1.4.2 & jQueryUI v1.8.1. (Though I tested it using UI v1.8, as well.) Here is a code example:
jQuery("#ElementDynamic").jqGrid({
postData: {gridID:"195",recordID:"1",parentID:"",user:"",gridFilter:"",applicationName:"Alchemy"},
colNames:['ID', '', 'Name', 'Type', 'Width', 'Style', 'Label', 'DB Column', 'Data Type', 'Align', 'Vert', 'Col'],
colModel:[
{name:"ID", width:50, align:"left", sortable:"true", sorttype:"int",editable:false, editrules:{required:false}, edittype:"text", editoptions:{datatype:"int"}, hidden:true},
{name:"ElementDynamicSelect",index:"ElementDynamicSelect",width:55,sortable:false},
{name:"Name", width:200, align:"left", sortable:"true", sorttype:"text",editable:true, editrules:{required:true}, edittype:"text", editoptions:{style:"width:96%; max-width:200px",datatype:"str"}, hidden:false},
{name:"ElementType", width:80, align:"left", sortable:"true", sorttype:"text",editable:true, editrules:{required:true}, edittype:"select", editoptions:{style:"width:98%; max-width:80px",datatype:"str",value:{"":"","Field":"Field","Label":"Label","Table":"Table","Container":"Container","Spacer":"Spacer","Pagebreak":"Pagebreak"}}, hidden:false},
{name:"Width", width:60, align:"left", sortable:"true", sorttype:"number",editable:true, editrules:{required:false}, edittype:"text", editoptions:{style:"width:96%; max-width:60px",datatype:"float"}, hidden:false},
{name:"ElementStyle", width:100, align:"left", sortable:"true", sorttype:"text",editable:true, editrules:{required:false}, edittype:"text", editoptions:{style:"width:96%; max-width:100px",datatype:"str"}, hidden:false},
{name:"Label", width:120, align:"left", sortable:"true", sorttype:"text",editable:true, editrules:{required:false}, edittype:"text", editoptions:{style:"width:96%; max-width:120px",datatype:"str"}, hidden:false},
{name:"DBColumn", width:120, align:"left", sortable:"true", sorttype:"text",editable:true, editrules:{required:false}, edittype:"text", editoptions:{style:"width:96%; max-width:120px",datatype:"str"}, hidden:false},
{name:"DataType", width:80, align:"left", sortable:"true", sorttype:"text",editable:true, editrules:{required:false}, edittype:"select", editoptions:{style:"width:98%; max-width:80px",datatype:"str",value:{"":"","Str":"Str","Int":"Int","Float":"Float","Percent":"Percent","Money":"Money","Bool":"Bool","Date":"Date","Time":"Time","Phone":"Phone","Datetime":"Datetime","SSN":"SSN"}}, hidden:false},
{name:"ElementAlignment", width:60, align:"left", sortable:"true", sorttype:"text",editable:true, editrules:{required:false}, edittype:"select", editoptions:{style:"width:98%; max-width:60px",datatype:"str",value:{"":"","left":"left","center":"center","right":"right"}}, hidden:false},
{name:"VerticalOrder", width:40, align:"left", sortable:"true", sorttype:"int",editable:true, editrules:{required:true}, edittype:"text", editoptions:{style:"width:96%; max-width:50px",datatype:"int"}, hidden:false},
{name:"ColNum", width:40, align:"left", sortable:"true", sorttype:"text",editable:true, editrules:{required:false}, edittype:"select", editoptions:{style:"width:98%; max-width:50px",value:{"":"","3":"1"}}, hidden:false},
],
height: 242,
jsonReader: {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
id: "ID"
},
loadComplete: function(){
var ids = jQuery("#ElementDynamic").getDataIDs();
for(var i=0;i<ids.length;i++){
var cl = ids[i];
cl = cl.replace(/,/gi,"");
var ElementDynamicSelectCol = '<input style="height:21px;width:50px;" type="button" value="Select" onclick="submitCommand(\'edit|26|'+cl+'\');" />';
jQuery("#ElementDynamic").setRowData(ids[i],{ElementDynamicSelect:ElementDynamicSelectCol})
}
},
ondblClickRow: function(id){
jQuery("#ElementDynamic").editRow(id,true,function(rowid){generateDatepickers("#" + rowid);},false,"alchemy_dev_table_edit_run.py",{gridID:"195",recordID:"1",applicationName:"Alchemy"});
},
pager: jQuery("#ElementDynamic_pager"),
pgtext:"",
pginput:false,
pgbuttons:false,
viewrecords:true,
editurl:"alchemy_dev_table_edit_run.py",
caption: "Dynamic Elements"
}).navGrid("#ElementDynamic_pager",
{add:true,edit:false,del:true,search:false,refresh:false, view:false},
{width:266.7,savekey:[true,13],closeOnEscape:true,closeOnEscape:true,closeAfterEdit:true,editData:{gridID:"195",recordID:"1",applicationName:"Alchemy"},reloadAfterSubmit:true,beforeShowForm:function(formid){generateDatepickers("#FrmGrid_ElementDynamic");}},
{width:266.7,savekey:[true,13],closeOnEscape:true,closeAfterAdd:true,editData:{gridID:"195",recordID:"1",applicationName:"Alchemy"},reloadAfterSubmit:true,beforeShowForm:function(formid){generateDatepickers("#FrmGrid_ElementDynamic");}},
{height:110,width:275,closeOnEscape:true,msg:"Are you sure you want to delete the selected row?",delData:{gridID:"195",recordID:"1",applicationName:"Alchemy"},reloadAfterSubmit:true},
{}
);
20:08

09/05/2010

I am having similar behavior, although this is with a new jqGrid install and not with an upgrade. However, I've been over the code and JSON extensively and can't find any deviation from the examples. jqGrid 3.6.5, jQuery 1.4.2, jQueryUI 1.8.1.
I would be happy to try jqGrid 3.6.4, but I can't download it any longer...
13:07

Moderators
30/10/2007

Hello,
@Inara you have a error in the grid configuration.
The last object in colModel contain comma,
{name:"ColNum", width:40, align:"left", sortable:"true", sorttype:"text",editable:true, editrules:{required:false}, edittype:"select", editoptions:{style:"width:98%; max-width:50px",value:{"":"","3":"1"}}, hidden:false}, <===== Error
],
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.
19:58

27/07/2009

Tony,
Thanks for catching that trailing comma (it was being auto-generated by one of our code tools), but it doesn't appear to be what was causing the issue. I removed the comma in question, and the grids are still loading blank, with no associated error messages. The older versions of jqGrid (3.6.4 or less) seem to work with or without the comma in place, and the new versions fails with or without it in place.
Regards,
Matt
20:54

Moderators
30/10/2007

Hello,
Can you write by hand a simple grid - not generated from some code and test with the new version.
I feel that some not accepted chars are send to the grid configuration which causes this problem.
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.
21:26

27/07/2009

Tony,
I created a very simple, single-column grid, as follows:
<script type="text/javascript">
$(function(){
jQuery("#TestGrid").jqGrid({
colNames:['Test'],
colModel:[
{name:"TestCol", width:200, align:"left"}
],
height: "auto",
url:"/cgi-bin/testgrid.py",
datatype: "json",
mtype: "POST",
jsonReader: {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
id: "TestCol"
}
});
});
</script>
It is receiving the following JSON data from the test script:
{
page:"1",
total:"1",
records:"11",
rows:[
{TestCol:"Test1"},
{TestCol:"Test2"},
{TestCol:"Test3"}
]
}
With 3.6.4, it works perfectly, producing three rows. With 3.6.5, it doesn't produce any rows, but also throws no errors.
If it helps, I can send you the full html page and python script I used for the test, but they are literally bare bones.
Thanks for working with me to try to sort out the issue.
22:13

Moderators
30/10/2007

Hello,
Better provide a link to the problem. If possible do not include the min version, but the development one.
Thank you
Best 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.
00:17

27/07/2009

After a long debug/trace session with firebug, I finally found the source of the issue. It appears that the jqGrid 3.6.5 only supports strictly formatted JSON, with quotes around the name and value of each key. I tested flipping back and forth between 3.6.4 and 3.6.5 and dropping/adding the quotes in each to confirm that this was the problem. To use my example from above, the return data must be formatted as follows for jqGrid 3.6.5:
{
"page":"1",
"total":"1",
"records":"3",
"rows":[
{"TestCol":"Test1"},
{"TestCol":"Test2"},
{"TestCol":"Test3"}
]
}
I hope this information will quickly resolve the issue for anyone else that was still experiencing it.
@Tony: Was this change intentional? If so, you'll probably want to update the documentation on the wiki to indicate that you've started to follow the strict JSON formatting rules, since the current examples under the JSON instructions in the "Data Manipulation" section use the old style (name:"value") and will no longer run. In any case, thanks for all the work you put into jqGrid, and for being available on the forum to discuss these issues with users.
Regards,
Matt
14:16

Moderators
30/10/2007

Hello,
First of all thank you for this investigation.
The Long Story (for 3.6.5):
In order to support JSONP correct we switch from complete ajax event to success one.
This causes to overcome jqGrid parse function.
In the success event jQuery makes his own validation for the json object and if the json format returned from the server is not correct nothing happen.
That is: if you want to test this just use the jQuery ajax get function on the same request and see the result.
We need to update documentation for this purpose.
Again Thank you very much
Kind 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.
Most Users Ever Online: 715
Currently Online:
64 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