You can use dmx.parse
to parse expressions inside javascript, so adding dmx.parse('serverconnectheader.data.querysigheader[0].sig')
would give you the signature json. But you have to wait until the data is loaded before accessing it, otherwise you just get an undefined
.
The code I gave before also works with server connect, just hook in the done event from server connect and execute the function to generate the signature.
<dmx-serverconnect id="serverconnectheader" url="<<action_url>>" ondone="regenerateSig()"></dmx-serverconnect>
<script>
function regenerateSig() {
$('.sigPad').signaturePad({displayOnly:true}).regenerate(dmx.parse('serverconnectheader.data.querysigheader[0].sig'));
}
</script>