Forum
10:49
05/09/2008
On line 693 of version 3.2.3 of grid.base.js before the switch statement in the populate function add the following line.
if (typeof ts.p.datatype == 'function') {ts.p.datatype(gdata);}
This will allow a function to be called as the datatype. I currently use a json-rpc wrapper for my server side php code, which mimics my PHP classes. This takes care of all my json-rpc and jsonp-rpc calls. The current datatypes are limiting.
Datatype functions should call addJSONData addXMLData respectively when they have aquired their data. For examples of their use see the populate function stating on line 688 of version 3.2.3 of grid.base.js.
Datatype functions are supplied with a single object containig the request information, which normally would have been transformed into GET or POST arguments. This object is compatible with the data: option supplied to the jQuery $.ajax function. Again, look to the populate function for an example of it's use.
This is a feature, which is easy to add and use, and helpful if your data is supplied by other jQuery plugins, as mine is.
07:09
Moderators
30/10/2007
Hello,
That is really good. I will try to implement this.
It will be very good if you post here example.
Best Regards
Thanks
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.
02:34
Moderators
30/10/2007
Hello,
Of course these methods should become Privileged.
If you want to access them you should add something at end of base script before calling populate:
this.addXmlData = function (data) { addXmlData(data, this.bDiv) };
Then you can call it like this:
jQuery("#gridid").addXmlData(mydata);
The same for JSON
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.
Most Users Ever Online: 715
Currently Online:
58 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