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
Foreign Keys
19/11/2008
23:51
Avatar
kpdirection
Utah, USA
New Member
Members
Forum Posts: 2
Member Since:
14/11/2008
sp_UserOfflineSmall Offline

Hi,

I have a database in 3rd normal form; simplistic structures as follows;

branch:

branchid integer,

salesrepid integer,

branchaddress char(255);

salesrep:

salesrepid integer,

salesrepname char(50);

When I display the table of branches, it shows the sales rep ids, not their names.

I need the sales rep ids in there so that I can record updates, but I only want the customer to see the sales rep name.

Using JSON, the colmodel for the branch sales rep is as follows;

{name:'salesrep',index:'salesrep', width:90, editable: true, edittype:"select", editoptions:{value:"0:Fred;1:George;2:Noah"} },

So from this, I'd like the customer to see Fred, George and Noah as drop down options (this works), and when the customer just looks at the list of branches, he sees the correct foreign key reference - Fred, George or Noah as appropriate, and NOT 0,1 or 2, which is what happens at present.

What am I doing wrong?

Regards,

Pete.

21/11/2008
06:13
Avatar
palobo
Portugal
Member
Members
Forum Posts: 41
Member Since:
13/11/2008
sp_UserOfflineSmall Offline

Hi Pete.

I'm not quite sure I get what you want to do, but try the following:

Pass the salesrepid as a colum also, set key:true and hidden:true. Column salesrep should be there also but visible. That way you can reference salesrepid and view salesrep.

Hopes this helps

P.

24/11/2008
00:18
Avatar
kpdirection
Utah, USA
New Member
Members
Forum Posts: 2
Member Since:
14/11/2008
sp_UserOfflineSmall Offline

Hi Palobo,

Yes, that's exactly what I want to do! Thank you!

(I'm still a newbie at JQuery stuff, so sometimes the basic real answers get lost in the noise!)

Thanks again.

Pete.

24/11/2008
16:48
Avatar
palobo
Portugal
Member
Members
Forum Posts: 41
Member Since:
13/11/2008
sp_UserOfflineSmall Offline

Glad I could help! 😉

Cheers,
P.

24/11/2008
17:27
Avatar
Barry
Texas, USA
Member
Members
Forum Posts: 38
Member Since:
04/11/2008
sp_UserOfflineSmall Offline

Pete,

Did this work for you? I've got a grid with several foreign keys. I made it work, but I'm looking for a cleaner way.

Barry

25/11/2008
06:54
Avatar
palobo
Portugal
Member
Members
Forum Posts: 41
Member Since:
13/11/2008
sp_UserOfflineSmall Offline

Hi Barry,

The method I mentioned for Pete was setting a column with the needed id. If you are talking about the problem with the select input (Post returns value as it should but then when we load value, it displays value and not label 🙁 ) I had to do some serverside juggling to display the results correctly.

Cheers,
P.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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