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
Building jqGrid with local array data?
06/07/2009
12:47
Avatar
Deaddancer
Member
Members
Forum Posts: 3
Member Since:
06/07/2009
sp_UserOfflineSmall Offline

I've seen the example to build a jqGrid table using local data when the array data is hard coded in the same .js file as the grid definition, but how do I use this method when I have a dynamically built PHP result array? Is there an example showing how to display this array data without encoding it in json or xml (i.e. using datatype: 'local')?

06/07/2009
16:28
Avatar
Deaddancer
Member
Members
Forum Posts: 3
Member Since:
06/07/2009
sp_UserOfflineSmall Offline

Let me elaborate on my issue above; when I'm using a jqGrid with a datatype of local, I'm wondering how to pass a php array to the javascript function that's going to addRowData to my grid. 

I've thought about converting the php array to a delimited string, passing that string to the JS function, then having my JS function convert it to a javascript array, then process the rows. Does this sound feasible? I'm going to try it and I'll report back either way.

Also, if I wanted to use a json datatype in my grid, is their a way to define the json source as local, instead of posting it to a URL?

08/07/2009
05:54
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

What about using the build in json_encode and json_decode - also refer to php docs.

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:
48 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