Change ink sketch pad color
Hi,
i've found this thread here descriping the possibility to change the color of the ink sketch dynamical:
viewtopic.php?f=1&t=1126&p=4721&hilit=color#p4721
i've tried it out, but i dont get the signeturepad object back.
I'm able to set the new color by creating a complete new SignaturePad:
but this resets the whole skretch...
Why is the solution from the link not working?
i've found this thread here descriping the possibility to change the color of the ink sketch dynamical:
viewtopic.php?f=1&t=1126&p=4721&hilit=color#p4721
i've tried it out, but i dont get the signeturepad object back.
I'm able to set the new color by creating a complete new SignaturePad:
Code: Select all
var padControl = $('.sketchPad');
var signPad = new Plumsail.FD.SignaturePad(padControl[0]);
signPad.penColor = "red";
Why is the solution from the link not working?
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear ragesoft,
Have you added an appropriate class to the Ink Sketch in the editor? This is used for reference in the example.
Have you added an appropriate class to the Ink Sketch in the editor? This is used for reference in the example.
Cheers
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear ragesoft,
There could be an issue if you are trying to change color before the Ink Sketch control loads, to prevent it use the following code:
Tell me if this is the case or not. And if it is, does the code help? If it doesn't, please show me your browser's console from the form, so I can see the error, please. But I hope this will fix it.
There could be an issue if you are trying to change color before the Ink Sketch control loads, to prevent it use the following code:
Code: Select all
var interval = setInterval(function(){
if($('.sketchPad')){
var signaturePad = $('.sketchPad').data('signaturePad');
signaturePad.penColor = 'red';
clearInterval(interval);
}
}, 1000);
Cheers
i dont belive its a time problem, because the signaturePad data isn't available even after opening dev-tools in browser and search for it with console.
In console there are no SPForms related errors (see screenshot).
Pls see also the html of the canvas inside the form.
If i debug the plumsail.fd.core.js and plumsail.fd.signature.js i see the processing of the canvas and the initiation of the data objekt with line:
but after this, the data is not available at the html object
In console there are no SPForms related errors (see screenshot).
Pls see also the html of the canvas inside the form.
If i debug the plumsail.fd.core.js and plumsail.fd.signature.js i see the processing of the canvas and the initiation of the data objekt with line:
Code: Select all
i.data("signaturePad", t);
- Attachments
-
- spforms_inksketch_debug.png (45.65 KiB) Viewed 1893 times
-
- spforms_inksketch_html.png (24.57 KiB) Viewed 1893 times
-
- spforms_inksketch_consollog.png (21.58 KiB) Viewed 1893 times
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear ragesoft,
Can you please tell me which version of Forms Designer you are using? It can be found in the bottom right corner: And also, version of SharePoint in question - is it SharePoint Online or SharePoint 2013/16?
Can you please tell me which version of Forms Designer you are using? It can be found in the bottom right corner: And also, version of SharePoint in question - is it SharePoint Online or SharePoint 2013/16?
Cheers
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear ragesoft,
Can you show me what code you are trying to use inside JavaScript framework as it is? And also, try to use the same code from browser's console. I want to see the error itself that you get.
Can you show me what code you are trying to use inside JavaScript framework as it is? And also, try to use the same code from browser's console. I want to see the error itself that you get.
Cheers
Here is my code inside the "JavaScript" option from the Editor:
($(this) is related to a textfield "onchange" event )
And here is the code from console:
Code: Select all
var signPad = $('.sketchPad').data('signaturePad');
signPad.penColor = $(this).val();
console.log("New Color: " + $(this).val());
And here is the code from console:
Code: Select all
var signaturePad = $('.sketchPad').data('signaturePad')
undefined
signaturePad
undefined
-
- Information
-
Who is online
Users browsing this forum: No registered users and 6 guests