Binding server connect variable inside Javascript

The code is probably called to early, the sig data isn’t loaded yet on document ready.

Have a function on the page to set the signature and call it on the done event of your json datasource.

<dmx-json-datasource id="jsonDS1" is="dmx-serverconnect" url="sig.json" ondone="regenerateSig()"></dmx-json-datasource>
<script>
function regenerateSig() {
  $('.sigPad').signaturePad({displayOnly:true}).regenerate(dmx.parse('jsonDS1.data'));
}
</script>
1 Like