Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: How to change active record and highlight active record

  1. #1
    Senior Member
    Join Date
    Jan 2014
    Posts
    348

    How to change active record and highlight active record

    Hi all

    I have a page with a single grid section

    The section has a footer menu with "Next", "Prior" action buttons

    When I activate the page, the grid show but active record is not highlighted until I click on it

    May I can do following using code

    a) Highlight the active record in grid
    b) Move the active record to next or previous
    c) Change the active record field values

    My following code in my custom menu delegate does not work

    proc leave_balance_list_custommenu(tcAction)
    do case
    case tcAction = "Down"
    if not eof()
    skip
    endif
    if eof()
    go bottom
    endif
    case tcAction = "Up"
    if not bof()
    skip -1
    endif
    if bof()
    go top
    endif
    endcase
    endproc

    Your advice is much appreciated

    Thanks & Best Regards

  2. #2
    Lianja Support Team lianjasupport's Avatar
    Join Date
    Feb 2012
    Location
    Boston USA, Wokingham UK
    Posts
    1,268
    You cannot navigate records in code like that. The grid knows nothing about the active record changing.

    See the reference on the grid class methods and call them.

    http://www.lianja.com/doc/index.php/Grid

  3. #3
    Senior Member
    Join Date
    Jan 2014
    Posts
    348
    Hi

    May I know how do I select the grid?

    I have tried following but does not work

    proc clock_records_list_custommenu(tcAction)
    do case
    case tcAction = "Return"
    Lianja.showdocument("page:staffkiosk")
    case tcAction = "Down"
    Lianja.get("page.clock records.list")next()
    case tcAction = "Up"
    Lianja.get("page.clock records.list")previous()
    endcase
    endproc

    Your advice is much appreciated

    Thanks & Best Regards

  4. #4
    Senior Member
    Join Date
    Jan 2014
    Posts
    348
    Hi

    Missed out some dot and colon and my latest code still cannot work

    proc clock_records_list_custommenu(tcAction)
    do case
    case tcAction = "Return"
    Lianja.showdocument("page:staffkiosk")
    case tcAction = "Down"
    Lianja.get("page:clock_records.list").next()
    case tcAction = "Up"
    Lianja.get("page:clock_records.list").previous()
    endcase
    endproc

  5. #5
    Lianja Support Team lianjasupport's Avatar
    Join Date
    Feb 2012
    Location
    Boston USA, Wokingham UK
    Posts
    1,268
    Next() and previous() are for skipping pages of records. Your grids don't have pages of records as you have pagination off.

    What is it you are emptying to do? Click the next() it to to fetch the next page or arrow down through the rows. Please explain.

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,695
    You need to use the doScroll() method like this if you want to move down the rows of the grid.

    Lianja.get("clock_records.list").grid.doScroll( arg )

    Note that Lianja.get() does not require "page:", you are looking up the object.

    Lianja.showDocument() has many different commands so you need to specify "page:"

    The arguments to doScroll() are all documented on the grid object at
    http://www.lianja.com/doc/index.php/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

  7. #7
    Senior Member
    Join Date
    Jan 2014
    Posts
    348
    Hi

    I am trying to go down and up the rows or records in a grid and highlight the active record in the grid

    Your advice is much appreciated

    Thanks & Best Regards

  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,695
    Use doScroll( arg ) as previously mentioned.

    Is this grid readonly? If it is then the first row is selected and highlighted after a refresh().
    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. #9
    Senior Member
    Join Date
    Jan 2014
    Posts
    348
    Hi Barry

    The doscroll() works perfectly when I click the "Up" and "Down" footer buttons but I am still not able to initially highlight the active row when the page is first activated. I have tried putting code in the "Ready" and "Activate" delegate but the 1st row does not get highlighted

    Your advice is much appreciated

    Thanks & Best Regards

  10. #10
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,695
    If you make the grid "readonly" it will be highlighted.

    Otherwise

    Lianja.get("page1.section2").grid.activeRow = 0
    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

Page 1 of 2 12 LastLast

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