PDA

View Full Version : PDF Convertion button



willylord
18 Oct 2013, 6:40 AM
Hi.
I'm looking for a Pdf convertion button plug-in for the TreeGrid.

It exist?

This is my core code, where I need to adds that.

<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />

<script language="Javascript" src="functions.js"></script>
<script language="Javascript" src="overlib.js"></script>

<script type="text/javascript" src="ext4gpl/bootstrap.js"></script>

<script>
$(function() {
$( "#start").datepicker({
dateFormat: "yy-mm-dd"
});
});

$(function() {
$( "#finish" ).datepicker({
dateFormat: "yy-mm-dd",
});
});
</script>

<style>
.ui-datepicker-div
{
top: 180px;
}
</style>

<script type="text/javascript">

Ext.require([
'Ext.data.*',
'Ext.grid.*',
'Ext.tree.*'
]);

Ext.onReady(function() {
//we want to setup a model and store instead of using dataUrl
Ext.define('Task', {
extend: 'Ext.data.Model',
fields: [
{name: 'ordine', type: 'string'},
{name: 'importo', type: 'currency'},
{name: 'righe', type: 'float'},
{name: 'data', type: 'data'},
{name: 'note', type: 'string'}
]
});

var store = Ext.create('Ext.data.TreeStore', {
model: 'Task',
proxy: {
type: 'ajax',
//the store will get the content from the .json file
url: '<?=$jsonUrl?>'
},
folderSort: true
});

Ext.define("My.LoadMask", {
extend: "Ext.LoadMask",

constructor: function(comp, config) {
var patch = false;
if (!comp.zIndexManager) {
patch = true;
comp.zIndexManager = {};
}

this.callParent(arguments);

if (patch) delete comp.zIndexManager;
},

onDestroy: function() {
this.bindStore(null);
this.callParent(arguments);
}

});

//Ext.ux.tree.TreeGrid is no longer a Ux. You can simply use a tree.TreePanel
var tree = Ext.create('Ext.tree.Panel', {
title: '<center><span style="font-variant:small-caps">Riepilogo ordini per agente</span></center>',
width: "100%",
height: "87%",
renderTo: Ext.getBody(),
collapsible: false,
useArrows: false,
rootVisible: false,
store: store,
multiSelect: true,
singleExpand: false,
//the 'columns' property is now 'headers'
columns: [{
xtype: 'treecolumn', //this is so we know which column will show the tree
text: 'Agente / Cliente',
flex: 2,
sortable: true,
dataIndex: 'ordine'
},{
text: 'Importo &euro;',
flex: 0.8,
dataIndex: 'importo',
align:'right',
sortable: true
},{
text: 'N.Righe',
flex: 0,
dataIndex: 'righe',
align:'right',
sortable: true
},{
text: 'Data',
flex: 0.8,
dataIndex: 'data',
sortable: true
},{
text: 'Note',
flex: 2,
dataIndex: 'note',
sortable: false
}]
});
});


</script>


Thanks

scottmartin
21 Oct 2013, 1:29 PM
You want to create a PDF? I am not sure I understand. Can you elaborate?

Scott.

willylord
21 Oct 2013, 11:56 PM
Yes. I need o create a PDF from the Treegrid content

scottmartin
22 Oct 2013, 4:06 AM
I am only aware of server side solutions for creating PDF files.

You can have a look at :
http://itextpdf.com/
http://www.tcpdf.org/

Here is a client side option that I just found:
http://code.google.com/p/jspdf/

Scott.