This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SUPPORT Q&A - Displaying properties on a Grid

sunils - Sunday, December 23, 2007 6:40 AM:

I want to create and display a grid for the data model below.

item type A-- relation X -->item type B

Item type A -- relation y --> item type C

I want to display the grid on item type A with properties from item Type A, B,C and relations X,Y  but am unable to do so. I feel i can do that if I am able to begin the grid query with Item Type A but am unable to begin the query from Item Type A which is the context Item. please advise.

SamsAn - Wednesday, December 26, 2007 10:58 AM:

Hi.

I guess you want to open an instance of Type A and have the grid opened in the instance window. If it is true then Configurable Grid functionality will help.
Do the following steps to setup the grid (ItemTypes A, B, C, RelationshipTypes X, Y are supposed to be created before the steps).

0.  Create  the grid with props below:

 Query:

<Item type="A" id="{id}" select="a" action="get">
  <Relationships>
    <Item type="X" select="x,related_id(b)"/>
    <Item type="Y" select="y,related_id(c)"/>
  </Relationships>
</Item>

 Columns:

sort_order     Visible     Label     Width     Align     Xpath     Property     Starts Nested Row     Data Type
128    Yes    A    100    left    self::Item[@type='A']    a    No    default
200    No    RELATED    100    left    Relationships/Item    related_id    Yes    default
210    Yes    X    100    left    self::Item[@type='X']    x    No    default
512    Yes    B    100    left    related_id/Item[@type='B']    b    No    default
600    Yes    Y    100    left    self::Item[@type='Y']    y    No    default
640    Yes    C    100    left    related_id/Item[@type='C']    c    No    default                                             

1. Edit A ItemType (new window is opened). Go to RelationshipTypes tab of the window and add new RelationshipType (NoRelated, name=Faked XYGrid, Tab Label=My New Grid). Save ItemType A.

2. Edit Faked XYGrid RelationshipType (new window is opened). Select Relationship View tab, pick World there and set the grid created at step 0.

3. Open an instance of type=A, select  My New Grid tab.

-> The data will be displayed according to the configured grid. 

Hope it helps,

SamsAn. 



sunils - Thursday, January 3, 2008 6:34 AM:

Hi SamsAn,

Thanks for the help ...from what you have given will this query work?

 

for this data model

A ---X ---> B

X----ExRel ---> C

A --- Y ---> C

***********************

<Item type="A" id="{id}" select="a" action="get">
  <Relationships>
    <Item type="X" select="x,related_id(b)">

      <Relationships>

           <Item type="ExRel" select="q,related_id(c)"/>

     </Relationships>

    </Item>
    <Item type="Y" select="y,related_id(c)"/>
  </Relationships>
</Item>

 

Thanks and regards,

Sunil



SamsAn - Thursday, January 3, 2008 8:07 AM:

Yes, this query will work for the described data model.

SamsAn.