Forum



11:58

19/04/2010

Hello,
I'm trying to make my grid work using the jsonp protocol(cross domain calls).
I set the datatype: 'jsonp'. My problem is that the data is not loaded into the grid, I got an error: "o is undefined".
Using the development version of jqgrid I get "req is undefined" at grid.base.js:814 , this paragrapgh:
case "jsonp":
case "xml":
case "script":
$.ajax($.extend({
url:ts.p.url,
type:ts.p.mtype,
dataType: dt ,
data: $.isFunction(ts.p.serializeGridData)? ts.p.serializeGridData.call(ts,ts.p.postData) : ts.p.postData,
complete:function(req,st) {
if(st=="success" || (req.statusText == "OK" && req.status == "200")) {
if(dt === "xml") { addXmlData(req.responseXML,ts.grid.bDiv,rcnt,npage>1,adjust); }
else { addJSONData($.jgrid.parse(req.responseText),ts.grid.bDiv,rcnt,npage>1,adjust); }
if(lc) { lc.call(ts,req); }
if (pvis) { ts.grid.populateVisible(); }
}
req=null;
endReq();
},
Seems that req is undefined in complete() function. I can't feagure out why.
Checking with Firebug I can see that request is made, that data returned is ok.
My response looks like:
jsonp1271660942600({"page":"1","callback":"jsonp1271660942600","records":"1","total":1,"rows":[{"id":"1","cell":["1","Australia","Sydney Airport International Terminal Upgrade","Airports","342","na","2009-10","na\n","No"]}],"_uid":"bqTrxVtkZJwvdC1gE66U144919Bz0XUJ"});
Anyone using jggrid with jsonp?
Thanks
Ovidiu
14:05

Moderators
30/10/2007

Hello,
Thanks.
You can look here:
http://www.trirand.com/blog/?p.....38;ret=all
Also seems to be a problem with jQuery.
A quick look into jQuery code tell me that when a jsonp is used the method call his own complete callback ?!?? - really surprised.
We will try to support this with the next release.
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:
61 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