Mercurial > lada > lada-client
comparison app/controller/FilterResult.js @ 939:cbc0c3fdada6
LadaPrint: Give Feedback when printing is in Progress
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Wed, 30 Sep 2015 16:08:40 +0200 |
parents | fe85a4d23370 |
children | 1e2895bfa410 |
comparison
equal
deleted
inserted
replaced
938:fe85a4d23370 | 939:cbc0c3fdada6 |
---|---|
215 | 215 |
216 /** | 216 /** |
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 | |
221 //disable Button and setLoading... | |
222 button.disable(); | |
223 button.setLoading(true); | |
224 | |
220 var grid = button.up('grid'); | 225 var grid = button.up('grid'); |
221 var selection = grid.getView().getSelectionModel().getSelection(); | 226 var selection = grid.getView().getSelectionModel().getSelection(); |
222 var i18n = Lada.getApplication().bundle; | 227 var i18n = Lada.getApplication().bundle; |
223 var me = this; | 228 var me = this; |
224 var columns = []; | 229 var columns = []; |
325 success: function(response) { | 330 success: function(response) { |
326 var content = response.responseBytes; | 331 var content = response.responseBytes; |
327 var filetype = response.getResponseHeader('Content-Type'); | 332 var filetype = response.getResponseHeader('Content-Type'); |
328 var blob = new Blob([content],{type: filetype}); | 333 var blob = new Blob([content],{type: filetype}); |
329 saveAs(blob, 'lada-print.pdf'); | 334 saveAs(blob, 'lada-print.pdf'); |
335 button.enable(); | |
336 button.setLoading(false); | |
330 }, | 337 }, |
331 failure: function(response) { | 338 failure: function(response) { |
332 console.log('failure'); | 339 console.log('failure'); |
333 // Error handling | 340 // Error handling |
334 // TODO | 341 // TODO |
335 //console.log(response.responseText) | 342 //console.log(response.responseText) |
343 button.enable(); | |
344 button.setLoading(false); | |
336 if (response.responseText) { | 345 if (response.responseText) { |
337 try { | 346 try { |
338 var json = Ext.JSON.decode(response.responseText); | 347 var json = Ext.JSON.decode(response.responseText); |
339 } | 348 } |
340 catch(e){ | 349 catch(e){ |