Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SmartClient Treegrid with multiple DB tables

    SmartClient: v10.0p_2014-11-23/EVAL Development Only


    Hi there,

    I am sure this must have been covered many times but I seem unable to locate a basic example to get me going. I have created a simple MySQL DB containing three tables, for arguments sake I'll call them A, B & C.

    Each table contains a field called "ID" which is an auto-incrementing sequence.

    Each table contains a unique identifier called "GUID" (string representation of a GUID.

    Tables B & C contain a pointer to their parent table row called "PARENT_GUID" and each has a relationship created between it and its parent as a one to many foreign key.

    A is the overall parent, rows in table B use their "PARENT_GUID" column to point to the parent in table A. Rows in table C use their "PARENT_GUID" column to point to the parent in table B.

    I have used the Datasource creator to create a DS, set the auto-discover schema option to true, set loadondemand to false.

    However, when I load my simple jsp, the treegrid renders with the parent folders, (the only two rows in table A) ... but when I double click a folder, the expansion simply shows the same folders at the next level down. If I use the dev console I can see the SQL reselecting the same rows for each expansion.

    I must be missing the point and am happy to admit it but I cannot see what I'm overlooking.

    Any examples / advice would be very much appreciated.

    Cheers
    Andrew

    #2
    It's not clear what you're expecting - are you hoping that on opening a folder that comes from table A, the TreeGrid will automatically make a fetch against table B? This is not automatic, and you should read the Tree DataBinding overview to find out how the system actually works.

    Comment


      #3
      Originally posted by Isomorphic View Post
      It's not clear what you're expecting - are you hoping that on opening a folder that comes from table A, the TreeGrid will automatically make a fetch against table B? This is not automatic, and you should read the Tree DataBinding overview to find out how the system actually works.
      Thanks for the slightly acerbic reply, I was indeed hoping that perhaps an auto discovery of the schema may have autopopulated a treegrid based on the relationships discovered. Happy Christmas.

      Comment


        #4
        Well, you provided a bunch of technical detail but, critically, didn't actually say what you expected to happen. Make sure you let us know what you were expecting up front, because if we're guessing, we're not going to respond with a bunch of guidance that may not apply, since that's just confusing.

        As far as how to actually implement pulling data into a tree from multiple DataSources, we have a wiki article here that shows sample code for SmartGWT, and the technique is identical for SmartClient.

        Comment


          #5
          Thanks - message received loud and clear, I'll stand in the corner & hang my head in shame.

          Cheers
          Andrew

          Comment


            #6
            No one's trying to shame you.

            Be careful not to project tone onto a text communication, you can easily read a sentiment that isn't really there.

            Comment


              #7
              Sorry, just my sad sense of humo(u)r .... I very much appreciate the pointers to the appropriate examples you've provided.

              Thanks and have a good one.
              Andrew

              Comment

              Working...
              X