FoxInCloud
Using Javascript library in FoxInCloud
Gravatar is a globally recognized avatar based on your email address. Using Javascript library in FoxInCloud
  Arcadio Bianco
  All
  Jan 5, 2020 @ 01:13pm

Hello! I need to implement this qz-tray printing routine on my FOXINCLOUD form. Where to put JS files and how to make Javascript calls in vfp buttons?

<html>
<head>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
</head>

<!-- Required scripts -->
<script type="text/javascript" src="rsvp-3.1.0.min.js"></script>
<script type="text/javascript" src="sha-256.min.js"></script>
<script type="text/javascript" src="qz-tray.js"></script>
<script type="text/javascript" src="qz-tray-javascript.js"></script>

<!-- Page styling  -->
<!-- C:\Program Files (x86)\Microsoft Visual FoxPro 9\Tools\AB\AW\Scripts\_Source\jQuery-3.1.1.js  -->
<script type="text/javascript" src="C:/Program Files (x86)/Microsoft Visual FoxPro 9/Tools/AB/AW/Scripts/_Source/jQuery-3.1.1.js"></script>

<button type="button" onClick="startConnection();" >Conectar</button>
<button type="button" onClick="endConnection();" >Desconectar</button>
<button type="button" onClick="findPrinter('ZDesigner', true);" >Seleciona Zebra</button>

<div id="qz-connection" class="panel panel-default">
    <label>Conexao:</label>
    <span id="qz-status" class="text-muted" style="font-weight: bold;">Unknown</span>
</div>

<div class="form-group">
    <label>Current printer:</label>
    <div id="configPrinter">NONE</div>
</div>

<button type="button" onClick="printCommand();" >Imprimir Etq</button>

</html>

<script type="text/javascript">
    window.onload = startConnection();
</script>

Gravatar is a globally recognized avatar based on your email address. re: Using Javascript library in FoxInCloud
  FoxInCloud Support - Thierry N.
  Arcadio Bianco
  Jan 6, 2020 @ 10:10am

Hi Arcadio!

Please see in awServer.prg:

  • awProcess.cawJSinc()
  • awProcess.cawCSSinc()

Also, you'll find several discussions on the same subject here.

Gravatar is a globally recognized avatar based on your email address. re: Using Javascript library in FoxInCloud
  Arcadio Bianco
  FoxInCloud Support - Thierry N.
  Jan 6, 2020 @ 10:41am

I was able to call file functions in awProcess.cawJSinc (), now I need to call the button. Have an example in the Live Tutorial?

Gravatar is a globally recognized avatar based on your email address. re: Using Javascript library in FoxInCloud
  FoxInCloud Support - Thierry N.
  Arcadio Bianco
  Jan 6, 2020 @ 10:44am

you can just use this code sample:

procedure btnConnect.click
…
if thisform.wlHTMLgen
  return "startConnection();"
endif
…
© 1996-2020