Editing one to many relationships in same page

A place for users and developers of the Xataface to discuss and receive support.

Editing one to many relationships in same page

Postby tomhousley » Wed Aug 05, 2009 12:50 am

Hello,

I have two tables, tbl_organisations & tbl_individual, these have a relationship defined in relationships.ini as:

Code: Select all
[People in this organisation]
__sql__ = "SELECT * FROM tbl_individual WHERE org_id='$org_id'"


When editing a record from tbl_organisations, I would like to be able to have the list of individuals in an editable table within that edit form.

Below is a screenshot from SugarCRM, which has an example of what I am trying to emulate, though with table of child records editable.

Image


Many thanks, Tom
tomhousley
 
Posts: 52
Joined: Thu Feb 26, 2009 1:02 am
Location: United Kingdom

Postby shannah » Wed Aug 05, 2009 12:07 pm

Well.. there's nothing that is exactly like this right now, however there are some similar things and it wouldn't be hard to do exactly this with a little bit of development.

Similar things:
1. Using the grid widget in the edit form.
2. Filling a slot on the related record list (can't think of the slot right now - maybe before_related_records_list? --- enter debug mode for a list of available slots).


Something like this could quite easily be developed. Add this to the issue tracker and I'll see if I can get to it for an upcoming release.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

widget:type=grid not saving

Postby tomhousley » Wed Aug 05, 2009 1:01 pm

Hi Steve,

Thank you for the suggestion. I have tried the widget:type=grid, the contents of which are:

Code: Select all
[Individuals]
widget:label = "Individuals"
transient=1
relationship=People in this organisation
widget:type=grid
widget:columns="ind_firstname,ind_lastname,ind_tel"


My relationships.ini looks like this:

Code: Select all
[People in this organisation]
__sql__ = "SELECT * FROM tbl_individual WHERE org_id='$org_id'"


The rows of individuals display fine, but there is no way to delete a record, ie. no icon showing.

It looks like your image (shown below) on the wiki but without the red cross and the sort order thing.

Image

Many thanks, Tom
tomhousley
 
Posts: 52
Joined: Thu Feb 26, 2009 1:02 am
Location: United Kingdom

Postby shannah » Wed Aug 05, 2009 1:06 pm

This is likely a permissions issue. Check the permissions on your relationship to ensure that the remove related record and delete related record permissions are allowed.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Wed Aug 05, 2009 1:06 pm

Another thing is that your relationship name shouldn't have spaces in it. If you want to name it you can provide the action:label attribute.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby tomhousley » Thu Aug 06, 2009 1:20 am

Hi Steve,

That's perfect. Thank you very much.

I have added details on the grid to the wiki:

http://xataface.com/wiki/grid
tomhousley
 
Posts: 52
Joined: Thu Feb 26, 2009 1:02 am
Location: United Kingdom


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 19 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved