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

Thread: Javascript Equivalent

  1. #1
    Senior Member
    Join Date
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658

    Javascript Equivalent for Grid Object

    Hello,

    I'm am trying to convert a desktop app to a web app.
    I don't have much experience with javascript.

    How would I do the following in Javascript?

    Code:
    oGrid = Lianja.get("page1.section2").grid
    nActiveRow = oGrid.ActiveRow
    nCommNum = oGrid.item(oGrid.ActiveRow,3)
    My attempts so far have generated parse errors in Lianja's console.

    Cory
    Last edited by CGibson; 2015-08-12 at 15:20.

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    The Web Client grid does not yet support the accessing of individual cells of the grid like that. furthmore it always uses pagination by design to provide acceptable performance on web and mobile devices.
    Last edited by barrymavin; 2015-08-13 at 03:46.
    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

  3. #3
    Senior Member
    Join Date
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658
    Hi Barry,

    Thanks for the response.
    I will submit an ER for more grid access.

    Cory

  4. #4
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,941
    Hi Barry,

    so if we need to get the value for a particular column on the current row, how might we do that?

    thanks,

    Hank

  5. #5
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    Hi Hank,

    The grid columns are data bound. Selecting a row makes that record active in the cursor. So you reference the columns from the cursor.
    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. #6
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,941
    Hi Barry,

    that's what I was hoping, and figured Cory and others would benefit from the reply.

    thanks,

    Hank

  7. #7
    Senior Member
    Join Date
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658
    Hello,

    Thanks for the added explanation.
    Based on the first response, I didn't think you could access the information.

    With my limited javascript knowledge, could someone provide some brief code on how to do this?
    My grid is bound to a virtual table.
    Say VT name is QWERTY, active row is 5 and column data is in column 8.

    Cory

  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    var orders = Lianja.getCursor("orders");
    var customerid = orders.getData("customerid");
    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
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658
    Thanks for providing sample code.
    This ensures I'm using the correct syntax.

    I'm not having much luck with this.
    Several attempts in the development view only take the information from the very first record in the table, not the selected record in the grid (performed from a double click event).
    Nothing seems to work when previewing in a web browser.
    I am using 'Lianja.writeOutput' to see the results.

    How does this work for web usage?
    Isn't the client disconnected from the data or does the VT association make a difference?

    Cory

  10. #10
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,941
    Hi Cory,

    are you saying that Barry's example doesn't work in the web app?

    Hank

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