Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
w2pext
plugin_dbui
Commits
9928fc8d
Commit
9928fc8d
authored
Dec 13, 2015
by
LE GAC Renaud
Browse files
Use the method App.saveAs in the grid plugin Export.
parent
cb26baf6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
7 deletions
+27
-7
static/plugin_dbui/src/grid/plugin/Export.js
static/plugin_dbui/src/grid/plugin/Export.js
+23
-6
views/plugin_dbui/latex2pdf.pdf
views/plugin_dbui/latex2pdf.pdf
+1
-0
views/reports/report_4.html
views/reports/report_4.html
+3
-1
No files found.
static/plugin_dbui/src/grid/plugin/Export.js
View file @
9928fc8d
...
...
@@ -15,6 +15,13 @@ Ext.define('App.grid.plugin.Export', {
alias
:
'
plugin.pGridExport
'
,
requires
:
'
Ext.form.action.StandardSubmit
'
,
/**
* @cfg {String]
* The root to construct the filename when exporting data.
* The file name is built as root.ext where ext is csv, tex or pdf.
*/
fileRoot
:
undefined
,
/**
* @cfg {String}
* The new line separator used in the CSV / LaTeX file.
...
...
@@ -151,9 +158,14 @@ Ext.define('App.grid.plugin.Export', {
"
use strict
"
;
var
me
=
this
,
data
=
me
.
getCmp
().
toCSV
();
App
.
save
(
"
csv
"
,
data
);
data
=
me
.
getCmp
().
toCSV
(),
root
=
me
.
fileRoot
;
if
(
root
!==
undefined
)
{
App
.
saveAs
(
root
+
"
.csv
"
,
data
);
}
else
{
App
.
save
(
"
csv
"
,
data
);
}
},
/**
...
...
@@ -165,9 +177,14 @@ Ext.define('App.grid.plugin.Export', {
"
use strict
"
;
var
me
=
this
,
data
=
me
.
doLaTeX
();
App
.
save
(
"
tex
"
,
data
);
data
=
me
.
doLaTeX
(),
root
=
me
.
fileRoot
;
if
(
root
!==
undefined
)
{
App
.
saveAs
(
root
+
"
.tex
"
,
data
);
}
else
{
App
.
save
(
"
tex
"
,
data
);
}
},
/**
...
...
views/plugin_dbui/latex2pdf.pdf
View file @
9928fc8d
...
...
@@ -2,6 +2,7 @@
try:
response.headers['Content-Type']='application/pdf'
response.headers['Content-Disposition']='attachment;filename="latex2pdf.pdf"'
response.write(data, escape=False)
except:
...
...
views/reports/report_4.html
View file @
9928fc8d
...
...
@@ -45,7 +45,9 @@
// instantiate the grid
Ext
.
create
(
'
App.grid.Panel
'
,
{
plugins
:
[
'
pGridExport
'
],
plugins
:
[{
fileRoot
:
"
report_4
"
,
ptype
:
"
pGridExport
"
}],
store
:
cfgStore
,
columns
:
[
{
text
:
"
Controller
"
,
dataIndex
:
'
controller
'
,
flex
:
0.8
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment