Jump to content


Displaying information from another table in read/edit view

set_relation read view edit view join

  • Please log in to reply
8 replies to this topic

#1 Prout

Prout

    Newbie

  • Members
  • Pip
  • 6 posts
  • LocationLondon

Posted 23 August 2013 - 03:25 PM

Hi,

 

I have gone through a few topics on the forum and I've seen some elements of answers but I can't find a definite answer.

 

I'm trying to display information from another table in the read/edit view. In my example, it's displaying comments against a customer.

 

Displaying customer information is fine but then displaying all the comments for that customer on the read view is tricky.

 

The solution, I've seen so far seem to talk about callback and writing your own model.

 

Without going in and modifying the Grocery CRUD library, how could this be achieved?

 

tables structure:

 

CLIENT

id

title

firstName

lastName

 

COMMENTS

id

comment

clientId <--- id of the client for which the comment relates to (there could be more than one comment per client)

 

As I'm a grocery CRUD newbie, I'm taking any piece of code you could provide! :rolleyes:

 

Thanks!

 

 



#2 davidoster

davidoster

    Grocery CRUD Ninja

  • Advanced Member
  • PipPipPip
  • 1,068 posts
  • LocationAthens, Greece

Posted 23 August 2013 - 10:51 PM

Hello and welcome to the forums Prout.

Do you mean something like this?

http://eletter.gr/te...ultigrids2/3028

*press the blue button on the first column under customers


____________________________________________________________

 

rtfm_small.jpg---!!!Please read these guidelines before asking to the forums!!!---

____________________________________________________________

 

David Oster aka George Pasparakis,
http://odphotography.com
http://eletter.gr


#3 Prout

Prout

    Newbie

  • Members
  • Pip
  • 6 posts
  • LocationLondon

Posted 27 August 2013 - 12:04 PM

Hi David,

 

sorry for the late reply, the Grocery CRUD email ended up in my junk!!!!

 

What you've done is sort of what I'm looking for.

 

Ideally, it's showing the read view with the extra information at the top (as oppose to the list view in your example) and have a customized display (as oppose to the list display for each of your item - customers, attendance, etc). But I guess that's a good start.

 

Could you tell me how you achieved this? where did you put the code to call and display the additional information?

 

Thanks! :rolleyes:



#4 davidoster

davidoster

    Grocery CRUD Ninja

  • Advanced Member
  • PipPipPip
  • 1,068 posts
  • LocationAthens, Greece

Posted 27 August 2013 - 12:26 PM

Give me a couple of days time to finish what I am doing and I will make an elaborate example of how this can be achieved.


____________________________________________________________

 

rtfm_small.jpg---!!!Please read these guidelines before asking to the forums!!!---

____________________________________________________________

 

David Oster aka George Pasparakis,
http://odphotography.com
http://eletter.gr


#5 Prout

Prout

    Newbie

  • Members
  • Pip
  • 6 posts
  • LocationLondon

Posted 27 August 2013 - 01:24 PM

Ok thanks, can't wait!!!!!!!!

:ph34r:  :ph34r:  :ph34r:  :ph34r:



#6 Prout

Prout

    Newbie

  • Members
  • Pip
  • 6 posts
  • LocationLondon

Posted 19 September 2013 - 02:20 PM

Hi David,

 

just wanted to know if you managed to work out an example?

 

Cheers



#7 davidoster

davidoster

    Grocery CRUD Ninja

  • Advanced Member
  • PipPipPip
  • 1,068 posts
  • LocationAthens, Greece

Posted 20 September 2013 - 08:05 PM

Sorry for this! I knew I was forgetting something.

I haven't managed to make an example so I will just share the actual code for it, which I should have done by the first day.

Sorry about this :/

Also Amit Shah was asking for this code.So here it is: https://dl.dropboxus...ter_details.zip


____________________________________________________________

 

rtfm_small.jpg---!!!Please read these guidelines before asking to the forums!!!---

____________________________________________________________

 

David Oster aka George Pasparakis,
http://odphotography.com
http://eletter.gr


#8 Prout

Prout

    Newbie

  • Members
  • Pip
  • 6 posts
  • LocationLondon

Posted 20 September 2013 - 08:39 PM

Hi David,

 

thanks for this. I'll dig into your code and try to work out an example!

 

Thanks again :)



#9 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 24 September 2013 - 09:50 AM

Thanks David, i too will look into the same.. and sorry to have missed you and the forum for long :)







Also tagged with one or more of these keywords: set_relation, read view, edit view, join

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users