Reputation: 3099
i've got a RoR app that's pushing out json data to a jqgrid. the grid loads up, shows the proper page/row counts, but doesn't show any rows.
data:
{
"total":333,
"page":1,
"records":3333,
"rows":[
{"id":"267","cell":["42883","Enhancing Personal and Organizational Creativity (XP)","1"]},
{"id":"268","cell":["42883","Enhancing Personal and Organizational Creativity","1"]},
{"id":"266","cell":["42815","Strategic Decision Making (XP-Elective)","1"]},
{"id":"265","cell":["42811","Strategic Planning","1"]},
{"id":"264","cell":["42809","Best Practices in Innovation (XP)","1"]},
{"id":"260","cell":["42808","Grave to Cradle - The Basics of Restructuring and Bankruptcies","1"]},
{"id":"261","cell":["42808","Corporate Restructuring","1"]},
{"id":"262","cell":["42808","Grave to Cradle Corporate Restructuring","1"]},
{"id":"263","cell":["42808","Failure - Grave to Cradle Corporate Restructuing (XP)","1"]},
{"id":"259","cell":["42800","Competitive Strategy (XP)","1"]}
]
}
html:
$("#list").jqGrid({
url:courseSource + "/fulldata?instructor=" + instrId + "&course=" + courseId,
datatype: 'json',
mtype: 'GET',
colNames:['Course Number','Course Title', 'Number of Instructors'],
colModel :[
{name:'course_no', index:'course_no', width:200},
{name:'name', index:'name', width:500},
{name:'ins_count', index:'ins_count', width:260, align:'right'}
],
pager: '#pager',
rowNum:10,
rowList:[10,20,30],
sortname: 'course_no',
sortorder: 'desc',
viewrecords: true,
caption: 'Courses'
});
any ideas? i'm beyond lost here - i've got the common problems tackled - the locale is loaded before the jqgrid.js, the css is loaded, jquery and friends are loaded. what's goin on?
Upvotes: 0
Views: 676
Reputation: 222007
I suppose you have some small problem outside of the code which you posted in your question. Compare your full HTML page with the following page. It has exactly your code and your JSON data. You can see that all work without any problem. So the problem which you describ must be outside of the posted code.
Upvotes: 1