Question relating to treeview and relationship.ini

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

Postby wreid » Tue Oct 24, 2006 1:42 pm

Hi again,

I've continues in my pursuit to build out my old database.

I setup a relationship.ini file for my episode table

[SpecificEpisodes]
matrix_item.ITEM_ID = matrix_episode_item.ITEM_ID
matrix_episode_item.EPISODE_NUMBER = "$EPISODE_NUMBER"
action:label = "Items Specific to this Episode"


It seems to work fine it pulls the right items (it displays the "item_name" in the tree view), however, when i click on the [+] next to the items name is doesnt' pull up anything at all. I figured it would pull up the items info such as "item_id", "item_name" and "item desc"

Also, in the future I might want to use the the "item_id" instead of the "item_name" is there a way to change what it displays?

I would post an image of the effect, however, I'm not sure how to here.

Much Appreciated!
wreid
 
Posts: 27
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Tue Oct 24, 2006 2:29 pm

Hi,

The TreeView is meant to navigate through a record's relationships - not its values, so it won't show you all kinds of info under there.

However, it does show the title of a record that can be set in the delegate class by defining the getTitle() method.

e.g.

Code: Select all
function getTitle(&$record){
    return $record->val('item_id');
}


This will cause the record to display the item_id field instead of the item_name field. You can have the title return anything you want - and this will be displayed in the tree menu.

-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby wreid » Tue Oct 24, 2006 3:01 pm

Thanks again for the reply. I guess I was confused because all the other [+] tree views in the detail view give the actual tables info.

Can you give an example of a relationship type that I would be able to traverse using this type of method? I seem to be stuck after that first node - more for learning than anything else.

Thanks!
wreid
 
Posts: 27
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Tue Oct 24, 2006 4:14 pm


I guess I was confused because all the other [+] tree views in the detail view give the actual tables info.


They shouldn't be giving the table's info.. just the relationships in the table.
When you click the [+] beside a record, it will expand to show the relationships defined on that table.
If you click the [+] beside a relationship, it will show you the records in that relationship.
.. and so on...

If nothing happens when you click the [+] sign beside a record, then there are likely no relationships defined for that record's table (in its relationships.ini file).

-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 9 guests

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