PDA

View Full Version : Lianja.getCursor question



hmischel@diligentsystems.com
2014-04-09, 17:25
Hi,

I have a table in my app called lt_routes.

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


Select count(*) from lt_routes

I get the following.


77 records selected in 3ms

If I switch over to the JavaScript tab and issue the following


var routes = Lianja.getCursor("lt_routes");

I get;



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

barrymavin
2014-04-09, 20:45
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.

barrymavin
2014-04-09, 22:42
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.

hmischel@diligentsystems.com
2014-04-10, 06:13
637

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

barrymavin
2014-04-10, 06:30
Ah yes, the doc is wrong. Should be as you say after reading the code.

barrymavin
2014-04-10, 06:32
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.

hmischel@diligentsystems.com
2014-04-17, 13:10
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!

barrymavin
2014-04-17, 21:37
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.

jmartyr
2015-12-07, 19:14
Just wondering if the getCursor() function works on the desktop client now? I couldn't find it on the Roadmap.

Thanks.

barrymavin
2015-12-07, 21:02
Yes. You can test any JavaScript from the Javascript console.

1171