#1 2016-08-26 17:36:57

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Pass classes to Javascript

I know that the main goal of integration with JavaScript is the server side.
But I'm trying to use to allow some interaction on the client side...

So is possible, for example, pass a class to the JS?

Example:

Engine.GlobalObject.MyForm := Self; //MainForm

In JS

MyForm.Caption = MyForm.Caption + ' - Changed from JS';

If possible it would generate thread problems?

Offline

#2 2016-08-26 17:45:54

Orel
Member
Registered: 2014-04-14
Posts: 13

Re: Pass classes to Javascript

Yes. It is possible. See  SyNode/Samples/02 - Bindings for sample. In this sample main form is binded to js
But don't forget than you can work with js engine only in the same thread in what it was created. In opposite case you can get av

Last edited by Orel (2016-08-26 17:51:37)

Offline

#3 2016-08-26 20:00:01

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: Pass classes to Javascript

I'm using SynSM unit.

My installation not was SyNode/... 
I installing now...

Thanks!

Offline

Board footer

Powered by FluxBB