Forum


09:29

08/01/2009

Hey Tony,
Long time man. I love what you've been doing with the grid and I love what you have done with the site.
I've been looking at upgrading my grid to version 3.3 but I'm having some trouble. When I run it I get an error. Firebug tells me that it doesn't like repeatitems:false in the jsonReader part.
here is the code...
$("#results").jqGrid({
url: "SearchResults",
datatype: "json",
colNames: columnNames,
colModel: columnModel,
pager: jQuery('#pager2'),
rowNum:20,
rowList:null,
imgpath:"images/images",
sortname:'hord',
viewrecords:true,
sortorder:"desc",
multiselect: true,
width:gridwidth,
height:'100%',
onPaging: function(){
saveSelected(iterLimit, orderList);
},
loadComplete: function(){
$('#cb').prev().remove();
if($("#results").getGridParam("records")==0){
confirm("Error: no search results","Selection.jsp");
}
else
{
var page = $('#results').getGridParam("page");
var records = $('#results').getGridParam("records");
var recordsPP = $('#results').getGridParam("RowNum");
var x = records/recordsPP;
var returnArray = [];
if(x < page)
{
iterLimit = records%recordsPP;
}
else
{
iterLimit = recordsPP;
}
for(var i=1; i<=iterLimit; i++)
{
$('#'+i).children('td:first').next().addClass('link');
var ord = $('#'+i).children('td:first').next().text();
returnArray = orderList.find(ord);
var truefalse = typeof returnArray;
if(truefalse != 'boolean')
{
$('#results').setSelection(i);
}
$('#'+i).children('td:first').next().click(function(){
ord = $(this).text();
window.location.href = "Recap?ord="+ord+"&pg="+page;
});
}
}
},
shrinkToFit: true,
jsonReader: {root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems : false
}
});
It was working with 3.0, but with I put in the code for 3.3 it started having issues. Also, I added the root, page, total, and records part since putting in 3.3 thinking maybe it needed them. Nothing seems to help.
Thanks for any help.
Bryce
10:14

Moderators
30/10/2007

Hello,
I do not think that this is the problem.
Could you please post a part from data returned from the server?
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.
10:39

Moderators
30/10/2007

If you remove the jsonReader from parameters what is happen?
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.
08:16

Moderators
30/10/2007

Hello,
Glad to see thet this is the problem. Go in the documentation page to read what is needed to configure this.
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:
35 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