-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsignature.js
48 lines (45 loc) · 1.07 KB
/
signature.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Ext.setup({
onReady: function() {
var tp = new Ext.Panel({
fullscreen:true,
layout: {type: 'vbox', align: 'stretch'},
id: 'mainPanel',
items: [{
xtype: 'panel',
id: 'signaturePanel',
plugins: [new simFla.ux.plugins.signaturePad({width: 500, height: 100})]
},{
xtype: 'panel',
id: 'imagePanel',
width: 500,
height: 100,
layout: {type: 'vbox', align: 'stretch'}
}],
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
title: 'Signature'
},{
xtype: 'toolbar',
dock: 'bottom',
items: [{
xtype: 'button',
text: 'Reset',
handler: function() { Ext.getCmp('signaturePanel').plugins[0].reset()}
},{
xtype: 'spacer'
},{
xtype: 'button',
text: 'Get Image',
handler: function() {
Ext.getCmp('imagePanel').el.createChild({
tag: 'div',
style: 'background-image: url(' + Ext.getCmp('signaturePanel').plugins[0].getSignatureAsImage('DATA') + '); width: 500px; height: 100px'
});
Ext.getCmp('imagePanel').doComponentLayout();
}
}]
}]
});
}
});