Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: Moving records in web

  1. #11
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    Quote Originally Posted by SpringBox View Post
    Thanks Barry

    That works well.

    Given the event firing sequence, where would be the best place to automatically remove the filtercondition - section.Refresh() or somewhere else?

    Cheers

    Simon
    BTW It would have worked just fine all in one page if you had used the dblclick delegate rather than the click delegate.
    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
    Jan 2014
    Posts
    262
    Hi Guys

    Having tested properly, this works really well in dev.

    However we realise that we cannot return a field vaue from a grid in web and so have been trying to return the row number so that we can then use

    Lianja.getElementByID("page1.grid1").item(Row,Col) to read the contents of the relevant grid cell (customer_id).

    That value will then be used to build the filter expression to find the record as per Dev mode.

    We are struggling with the syntax required here, both to get the activerow and to then do get the item(row,col) values.

    When we try Lianja.getElementByID("page1.grid1").item(Row,Col) in the console, it just returns an empty object

    .ActiveRow and .ColumnCount etc just produce not found errors but we can reference .table and .database

    Maybe there is an easier way to do this. Read everything we can find.

    Any thoughts?


    Cheers

    Simon

    P.S the infinite grid scrolling in web is amazing !!

  3. #13
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,376
    Hi Simon,

    If 'grid1' is the name of the section, you need to reference 'page1.grid1.grid' to reference the grid object in the section.

    Regards,

    Yvonne

  4. #14
    Senior Member
    Join Date
    Jan 2014
    Posts
    262
    AHA !!

    Thanks Yvonne- thought we were going mad....

    Simon

  5. #15
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    You don’t need to do any of that in desktop or web / mobile.

    When you position on a row in a grid, the name of the controlsource e.g custname can be referenced as a JavaScript variable.

    you can verify this in the browser JavaScript console. Just click on a row then type the name of the variable you want to inspect in the console.
    Last edited by barrymavin; 2019-11-28 at 18:37.
    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
    Jan 2014
    Posts
    262
    Hi Barry

    This works great in Dev but is not working in web - We can access the correct cell value and we are setting the filter correctly but it is not yielding the correct record.

    We have tried to get access to the field value directly but believe that has no meaning in web.

    You say "When you position on a row in a grid, the name of the controlsource e.g custname can be referenced as a JavaScript variable."

    Can you please explain - we don't understand what this means. How can we referesnce this as a JavaScript variable?

    We have tried typing in the name of the field in the browser console but just get a "<fieldname> not defined" error as we would expect.

    This is the last link before app release

    Thnaks in advance

    Simon
    Last edited by SpringBox; 2019-11-28 at 18:29.

  7. #17
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    In your delegate just reference custname (or other fields that you have bound to the grid) as I explained earlier.

    Inspect these variables in the JavaScript console as suggested.
    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

  8. #18
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    A few days ago I gave you some code which constructed a filter expression in JavaScript. You need to go read that again.

    A filter expression is applied on the server so it cannot reference variables on the client. You need to construct literal strings.

    var filter = “custname=‘“ + custname + “‘“;

    which evaluates as

    ”custname=‘Smith’”

    which is sent to that server to fetch the required record.
    Last edited by barrymavin; 2019-11-28 at 18:37.
    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 MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,941
    The way I remember it (whether or not it's technically correct ) is, using your naming of page a section, page1.grid1 is a section. Page1.grid1.grid is the grid control.

    Hank

  10. #20
    Senior Member
    Join Date
    Jan 2014
    Posts
    262
    Hi Barry

    Thanks for the reply. Having now done a lot of testing, think we are talking at cross purposes. The filter construction is fine. This seems to be a web issue.

    In web, it seems neither the grid.click() or grid.doubleclick() delegates are firing

    We have added a menu item and have a working solution lifting the data from the relevant grid cell using :

    ogrid.item(lactiverow,lrequiredcolumn);

    Hope that helps

    Cheers

    Simon

Page 2 of 3 FirstFirst 123 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