Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
jsonp problem - cross domain call
19/04/2010
11:58
Avatar
satmovi
Member
Members
Forum Posts: 5
Member Since:
19/04/2010
sp_UserOfflineSmall Offline

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 "json":
                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

19/04/2010
14:05
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

19/04/2010
15:55
Avatar
satmovi
Member
Members
Forum Posts: 5
Member Since:
19/04/2010
sp_UserOfflineSmall Offline

Thanks Tony,

that really helps. I'll use the development version of jqgrid with this patch, hoping we'll have it fixed in the next relese.

Cheers

Ovidiu

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information