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
Best way to edit data from different tables?
11/01/2011
02:03
Avatar
rob-t
Member
Members
Forum Posts: 3
Member Since:
07/01/2011
sp_UserOfflineSmall Offline

I love jqGrid so far, but I am totally stuck.  I can't figure out how to edit data from multiple tables.  I have gone over every line of every tutorial, and I'm starting to think that it's just not possible.

This is the problem:  I can't seem to get anything to work, because in the first table ("users"), I have a primary key "uid", but in the second table that I also need to be able to edit, "profiles", I do not have that same primary key.  So I have to do a complex SQL select command that uses a third table as an intermediary (the "node" table):

$grid->SelectCommand = 'SELECT a.uid, a.name, b.firm, b.city, b.state, a.mail, b.paidmembershipdate, b.firmcategory FROM users a, profiles b, node c WHERE a.uid=c.uid AND c.nid=b.nid';

However, if I set up editing in jqGrid, it only can post the updates to the "users" table, since that is the table is chosen for editing in grid.php ($grid->table = 'users';) and that table has the primary key (uid).  Any other changes are NOT saved to the database.

Currently, I have a Master/Detail layout set up, with the Master grid displaying data from the "users" table, and the Detail grid displaying data from the "profiles" table.  However, this ALSO has to rely on a complex SELECT command in "detail.php", and it doesn't work - the detail table is blank unless I remove the last AND statement, in which case it displays all records, not the one that I select in the Master table.

$grid->SelectCommand = "SELECT a.uid, a.name, b.firm, b.city, b.state, a.mail, b.paidmembershipdate, b.firmcategory FROM users a, profiles b, node c WHERE a.uid=c.uid AND c.nid=b.nid AND uid= ?";

Am I going about this all wrong?  Can I edit two tables from the same grid?  If not, can I do it with a SubGrid or a Master/Detail setup?  Am I required to have the same primary key in both tables to do anything at all?

Please help, I will have to abandon this project and jqGrid in general if no one has any ideas on how to do this.  (You would think this would be easy.) Cry

14/01/2011
18:16
Avatar
rob-t
Member
Members
Forum Posts: 3
Member Since:
07/01/2011
sp_UserOfflineSmall Offline

There are a lot of threads in the help forum with no replies...

Is anyone supporting jqGrid?  Is the author/team still around? 

I'm not going to pay $300 for something that can't edit data from more than one table and has no support whatsoever... has anyone been able to get this to work?  How did you do it?

14/01/2011
19:05
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You are in the wrong forum.

Please post your problem here:

http://www.trirand.net/forum/

This place is for the open source Java Script only jqGrid, while you try the commetial jqGrid PHP component.

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