It is currently 10 July 2020, 9:47 Advanced search

SyncFusion JavaScript Example: Signature Capture

Questions and answers on how to best use Instant Developer

SyncFusion JavaScript Example: Signature Capture

Postby ljwilson » 27 November 2019, 21:28

This is just a proof of concept--it illustrates the bare minimum needed to embed one of the SyncFusion JavaScript controls inside an InDe application.

It works similarly to the Gauge example in this thread:

http://forum.instantdeveloper.com/viewtopic.php?f=7&t=87482

Syncfusion Capture Express.zip
InDe 19.5 r11 Express Version
(499.63 KiB) Downloaded 106 times


...jack
ljwilson
 
Posts: 528
Joined: 26 November 2013, 14:15

Re: SyncFusion JavaScript Example: Signature Capture

Postby lucabaldini » 28 November 2019, 8:27

Hi. That's cool!!

I've added something:
1) I've included all Javascript files into Desktop.htm and Desktop_sm.htm files... so that I don't need to load them by Javascript (but also your custom3.js was not bad at all... :-))))))
2) I've added a function that sends the signature to the server
3) I've added a SAVE button in the view...

P.S. for point 2 the library allows only to save the image on the user's computer as a PNG/JPG/... file... I wanted it on the server so that it can be stored somewhere without the user having to do it for me :-)
Attachments
Syncfusion Capture Express.zip
(480.38 KiB) Downloaded 95 times
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 4494
Joined: 1 October 2010, 17:03
Location: Bologna

Re: SyncFusion JavaScript Example: Signature Capture

Postby ljwilson » 28 November 2019, 12:53

Thanks Luca!

Your SaveSignature JavaScript function is very informative--I'll have to make use of that in other things.

One question though: I always thought we should avoid customizing the desktop*.htm files when possible since we then have to change them(or at least check them) whenever we do an InDe upgrade. Is there a performance or some other advantage to putting the JavaScript there rather than in custom3.js?

Thanks again...jack
ljwilson
 
Posts: 528
Joined: 26 November 2013, 14:15

Re: SyncFusion JavaScript Example: Signature Capture

Postby lucabaldini » 28 November 2019, 14:45

One question though: I always thought we should avoid customizing the desktop*.htm files when possible since we then have to change them(or at least check them) whenever we do an InDe upgrade. Is there a performance or some other advantage to putting the JavaScript there rather than in custom3.js?


You are right... there is no "right" nor "wrong" way of doing it... The reason I can give you is that I expect someone to customze both Desktop files, because that's what the "final" user sees... maybe you want a different image, different files, different loading/loaded animation, etc.... But that's not always true... maybe you haven't customized Desktop and your custom3.js custom file is perfect :-)
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 4494
Joined: 1 October 2010, 17:03
Location: Bologna

Re: SyncFusion JavaScript Example: Signature Capture

Postby lucabaldini » 28 November 2019, 14:46

Let's put it in this way: in this thread there are TWO different ways of loading javascript: one that uses a "traditional" way (desktop/script section), and another one that uses a "clever" (i.e. programmable) way by using custom3.js ;-)))))))
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 4494
Joined: 1 October 2010, 17:03
Location: Bologna

Re: SyncFusion JavaScript Example: Signature Capture

Postby Ted Giles » 28 November 2019, 15:06

Hi Luca.
I am using 13.5 and it works when I use the Seattle Theme.
On the other hand, the Clear Signature tries to restart the application on my PC.
Is that supposed to happen? It actually just "hangs" and won't start a separate instance.
Having said that, thanks for chipping in!
User avatar
Ted Giles
 
Posts: 496
Joined: 29 November 2013, 12:58
Location: The Wolds, Lincolnshire, UK

Re: SyncFusion JavaScript Example: Signature Capture

Postby lucabaldini » 28 November 2019, 15:19

Nope... what do you mean with "tries to restart the application"?

Do you mean that when you click the "Clear" button the app restarts? That's odd... it asks the client to execute a javascript expression using "eval" inside your browser... Unfortunately I don't remember if that function (executeOnClient) was working correcly (as it does not) in 13.5... I have to check...
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 4494
Joined: 1 October 2010, 17:03
Location: Bologna

Re: SyncFusion JavaScript Example: Signature Capture

Postby lucabaldini » 28 November 2019, 15:20

As far as I remember that function (executeOnClient) hasn't changed since when it was introduced... way before 13.5...
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 4494
Joined: 1 October 2010, 17:03
Location: Bologna

Re: SyncFusion JavaScript Example: Signature Capture

Postby lucabaldini » 28 November 2019, 15:21

Which project have you used with 13.5 and Seattle? The first or mine?
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 4494
Joined: 1 October 2010, 17:03
Location: Bologna

Re: SyncFusion JavaScript Example: Signature Capture

Postby lucabaldini » 28 November 2019, 15:39

I've found the problem... even in my project it does not work!!!

The cause is the saveWithBackground: true token I've forgotten in the EnableSignature event!
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 4494
Joined: 1 October 2010, 17:03
Location: Bologna

Next

Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests