comparison app/controller/FilterResult.js @ 938:fe85a4d23370

LadaPrint removed superfluous debug message and made printer more generic. In theory it should also be capable of printing messprogramme without further changes.
author Dustin Demuth <dustin@intevation.de>
date Wed, 30 Sep 2015 15:47:56 +0200
parents 6739bfdb743e
children cbc0c3fdada6
comparison
equal deleted inserted replaced
937:6739bfdb743e 938:fe85a4d23370
217 * Send the selection to a Printservice 217 * Send the selection to a Printservice
218 */ 218 */
219 printSelection: function(button) { 219 printSelection: function(button) {
220 var grid = button.up('grid'); 220 var grid = button.up('grid');
221 var selection = grid.getView().getSelectionModel().getSelection(); 221 var selection = grid.getView().getSelectionModel().getSelection();
222 console.log(selection);
223 var i18n = Lada.getApplication().bundle; 222 var i18n = Lada.getApplication().bundle;
224 var me = this; 223 var me = this;
225 var columns = []; 224 var columns = [];
226 var columnNames = []; 225 var columnNames = [];
227 var visibleColumns = {} 226 var visibleColumns = [];
227 var displayName = '';
228 var data = []; 228 var data = [];
229 229
230 // Write the columns to an array 230 // Write the columns to an array
231 try { 231 try {
232 for (key in selection[0].data) { 232 for (key in selection[0].data) {
239 catch (e) { 239 catch (e) {
240 console.log(e); 240 console.log(e);
241 } 241 }
242 242
243 //Retrieve visible columns' id's and names. 243 //Retrieve visible columns' id's and names.
244 // and set displayName
244 try { 245 try {
245 var grid = button.up('filterresultgrid'); 246 var grid = button.up('filterresultgrid');
246 var cman = grid.columnManager; 247 var cman = grid.columnManager;
247 var cols = cman.getColumns(); 248 var cols = cman.getColumns();
249
250 displayName = grid.down('tbtext').text;
251
248 for (key in cols) { 252 for (key in cols) {
249 if (cols[key].dataIndex) { 253 if (cols[key].dataIndex) {
250 visibleColumns[cols[key].dataIndex] = cols[key].text; 254 visibleColumns[cols[key].dataIndex] = cols[key].text;
251 } 255 }
252 } 256 }
303 var printData = { 307 var printData = {
304 'layout': 'A4 landscape', 308 'layout': 'A4 landscape',
305 'outputFormat': 'pdf', 309 'outputFormat': 'pdf',
306 'attributes': { 310 'attributes': {
307 'title': 'Auszug aus LADA', 311 'title': 'Auszug aus LADA',
308 'displayName': 'Proben', 312 'displayName': displayName,
309 'table': { 313 'table': {
310 'columns': columnNames, 314 'columns': columnNames,
311 'data': data 315 'data': data
312 } 316 }
313 } 317 }

http://lada.wald.intevation.org