Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 32

Thread: Get record data from treegrid

  1. #11
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,970
    Blog Entries
    18
    Hi David,

    Sorry but that makes no logical sense to me.

    If the section is bound to a table it has an active record.

    The treegrid is in that section so when the section is refreshed so will the Treegrid.

    So how are you expecting deggweight.cfk_degg = "{degg.cpk_degg}" to work? You will change the treegrid.

    How are you going to refresh the TreeGrid. Its an endless loop.
    Last edited by barrymavin; 2022-03-24 at 00:22.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  2. #12
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Hi Barry,

    It makes perfect sense to me, perhaps I'm not explaining it properly.

    Yes the tree grid refreshes when section 1 moves to a new egg record.

    I want to refresh the section2 when the user clicks on another row in the treegrid.

    Page with two sections

    Section 1 has the egg data

    section2 has the weight data for the egg

    Section 2 has a tree grid which has an SQL statement which display just some of that weight data.

    select tweight,nweight,nperlossatpip,lnotes,calive,ldrill ed,nveingrowth,cpk_deggweight from deggweight where deggweight.cfk_degg = "{degg.cpk_degg}"

    So the treegrid shows those fields for the egg weight record. Last one is the PK for the egg weight record the user is on in the treegrid

    When section one moves to a new egg section 2 updates to show the one record for the weights for the egg in the main UI and the grid displays a limited set of data for all the weights for the egg.

    UI in section 2 only shows one record, except for the tree grid which displays limited info for all of the weight record.

    Use is on say record 4 of 6 in the weights

    User clicks on row 2 in the treegrid and I want section 2 to goto record 2 and display the full data for that record, basically move to that record.

    I don't see any loop since we are simply moving between records of the weights.

    David
    Last edited by avianmanagement; 2022-03-24 at 00:26.

  3. #13
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    When the user moves to row 2 deggweight.cfk_degg will be the same value as when they were on row 6

    I'm picking up cpk_deggweight, the Pk of the weight record rather the pk of the egg, so there is no need to refesh the grid as the data in it does not change.

  4. #14
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Hi Barry,

    Lets simplify it a little

    Section1 egg record

    section 2 weight records for the egg, there are lets say 10 record of weights for the egg

    Section 2 UI currently shows the data for record 2 of the egg weights

    I know the PK value for record 6 of the egg weights

    How do I in section2 move to that record and update the UI in section 2 to show the weight data for record 6?

    David

  5. #15
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,970
    Blog Entries
    18
    Ok i misunderstood. So you want to refresh another section.

    Do you have a key on the table that the section is bound to?

    Just set the searchfilter.

    Lianja.get("yoursection2").searchfilter = your_key = the_value_from_the_tree_grid
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  6. #16
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Hi Barry,

    No I don't want to refresh another section.

    I want to refresh section 2, the one the tree grid is already on by using the PK I get from the values in the sql statement used to pull the data for the treegrid.

    I'll try the method you suggest as that will work I think

    Name:  eggpage.jpg
Views: 57
Size:  75.5 KB

  7. #17
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Hi barry,

    ////////////////////////////////////////////////////////////////
    // Event delegate for 'click' event
    proc page1_EggWeight_EggWeightGrid_click()

    local lcEggWeightPK
    lcEggWeightPK = (this.item(this.activerow,8))
    Lianja.writeOutput(lcEggWeightPK)
    Lianja.get("page1.EggWeight").searchfilter = lcEggWeightPK
    Lianja.getElementByID("page1.EggWeight.EggWeightGr id").caption = lcEggWeightPK
    Lianja.getElementByID("page1.EggWeight").refresh()

    //Lianja.writeOutput("Clicked on row " + etos(this.activerow) + ", info = 8 " + etos(this.item(this.activerow,8)))
    endproc

    This does not work, but I'd like to test this with the next beta where the refresh in the grid is fixed to be really sure I'm dealing with the correct records in the treegrid
    Last edited by avianmanagement; 2022-03-24 at 00:49.

  8. #18
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,970
    Blog Entries
    18
    If the TreeGrid is in the same section that you want to refresh I dont see how that can work as the TreeGrid itself will get refreshed.

    So why not have a grid section above this form that relates to this form. You seem to be wanting to relate other form content inside a section.

    If thast what you want you are making work for yourself unnecessarily as you are bypassing a lot of built-in functionality.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  9. #19
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,970
    Blog Entries
    18
    From what i understand a page navigation panel will do this for you.

    See the example_navpane2 app

    Click image for larger version. 

Name:	Screen Shot 2022-03-24 at 1.09.22 PM.jpg 
Views:	51 
Size:	120.7 KB 
ID:	2789

    Note that you can refresh the navigation panel dynamically:

    Lianja.get("page1").refreshNavigationPanel("select ... from ... where ....")

    The where condition can include {macros}
    Last edited by barrymavin; 2022-03-24 at 01:16.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  10. #20
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Hi Barry,

    OK so if the tree grid gets refreshed it's not an issue as far as I can see as it will just so the same information before and after the refresh.

    When the tree grid gets refreshed it is not going to do anything unless it is clicked on to move to another record for the egg weight

    The refresh is not going to fire the click code

    I need to section be laid out in a very specific way as we have spent years getting the UI layout to work for maximum productivity when weighing a lot of eggs.

    I just need to be able to take a PK value for deggweight and move to that record. Section 2 is bound to dEggweight.

    Why have a grid section above the form when the treegrid has the data I need to tel me whcih record I wan to move to.

    I'm not changing the egg by clicking on the row in the grid, just picking up a new Pk for deggweight, then I want to use that to move to the deggweight record for that PK.

    The deggweight record relate to the same egg as in section1

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us