Postări

Se afișează postări din august, 2015

JsonExport - plugin to generate XLS/XLSX from EXTJS Grid

JsonExport is a helper class who help you to generate data to use with PHPExcel to generate XLS/XLSX files. Is based on Ext.ux.grid.Printer . I create this plugin because i needed to export xls/xlsx from a ExtJS grid generated from a json feed. JsonExport are two parts: client side (JsonExport.js) and server side (export_xls.php) To setup you must define a button in your with a handler and an url to server-side file (export_xls.php) Let's start with an example. 1. Setup path to Ext.ux location in your javascript. Ext.Loader.setConfig({ enabled: true, paths: { Ext: '.', 'Ext.ux': '../ux' } }); 2.  Add Ext.Require Before the Grid code. Ext.require([ 'Ext.ux.grid.JsonExport' ]); 3. Create your grid. var grid = Ext.create('Ext.grid.Panel', { store: store, stateful: true, stateId: 'stateGrid', columns: [ {text: 'Company',data