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_TopicIcon
function datatype
05/09/2008
10:49
Avatar
aperson
New Member
Members
Forum Posts: 1
Member Since:
05/09/2008
sp_UserOfflineSmall Offline

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.

06/09/2008
07:09
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

07/10/2008
10:42
Avatar
BobFleischman
New Member
Members
Forum Posts: 2
Member Since:
06/10/2008
sp_UserOfflineSmall Offline

We tried this approach, however I am not sure how to call the private addJSONdata function from within our function.

Is there a working example we can examine?

Thanks

Bob

08/10/2008
02:34
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
39 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