Results 1 to 10 of 10

Thread: Lianja.getCursor question

  1. #1

    Lianja.getCursor question

    Hi,

    I have a table in my app called lt_routes.

    If I open the app inspector in the Lianja/vfp tab and issue;

    Code:
    Select count(*) from lt_routes
    I get the following.

    HTML Code:
    77 records selected in 3ms
    If I switch over to the JavaScript tab and issue the following

    Code:
    var routes = Lianja.getCursor("lt_routes");
    I get;

    HTML Code:
    Traceback (most recent call last):
    Console at line 1
    TypeError: Result of expression 'Lianja.getCursor' [undefined] is not a function.
    Since the table clearly exists, what am I doing wrong?

    Thanks.

    Herb

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,717
    Blog Entries
    17
    The Lianja.getCursor() and Lianja.createCursor() are currently only in the web/mobile client. They will be added into the desktop client in a point release.
    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
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,717
    Blog Entries
    17
    Hi Herb,

    Just a heads up. In a point release after v1.1 I will be making Lianja.openDatabase() and db.openRecordSet() available in the web/mobile client. This is in preparation for offline database support.
    Last edited by barrymavin; 2014-04-10 at 00:38.
    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

  4. #4
    Name:  getCursorError.jpg
Views: 193
Size:  58.2 KB

    Getting the same error in the web client.

    Just a note, it looks like it wants the database name passed in as a parameter along with the tablename.

    Herb

  5. #5
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,717
    Blog Entries
    17
    Ah yes, the doc is wrong. Should be as you say after reading the code.
    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 Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,717
    Blog Entries
    17
    In fact I will need to look as that's in the Application class that you are looking at.

    There is a Lianja.getCursor() that calls that later on in the code.
    Last edited by barrymavin; 2014-04-10 at 06:45.
    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
    Hi Barry,

    This is looking great. It seems you don't need to pass the database name.
    This works in the app and in the app inspector - which makes troubleshooting a breeze.

    var cursor = Lianja.getCursor("lt_routes");
    var routename = cursor.getData('routename');
    Lianja.showMessage(routename);
    Lianja.writeLog(routename);
    Thank you!

  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,717
    Blog Entries
    17
    No, Lianja.getCursor() works against the current internal cursors as you point it.

    Remember also that you have a lot of the LianjaVFP functions available to you in JavaScript to minimize coding and simplify development.
    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
    Junior Member
    Join Date
    Jul 2015
    Posts
    25
    Just wondering if the getCursor() function works on the desktop client now? I couldn't find it on the Roadmap.

    Thanks.

  10. #10
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,717
    Blog Entries
    17
    Yes. You can test any JavaScript from the Javascript console.

    Name:  Screen Shot 2015-12-08 at 10.00.50 AM.jpg
Views: 138
Size:  53.5 KB
    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

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