Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plugin_dbui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2pext
plugin_dbui
Commits
beab7310
Commit
beab7310
authored
10 years ago
by
LE GAC Renaud
Browse files
Options
Downloads
Patches
Plain Diff
Better Coding for grid.mixin.ExportLatex.
parent
a22c1c51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
static/plugin_dbui/src/grid/mixin/ExportLatex.js
+9
-21
9 additions, 21 deletions
static/plugin_dbui/src/grid/mixin/ExportLatex.js
with
9 additions
and
21 deletions
static/plugin_dbui/src/grid/mixin/ExportLatex.js
+
9
−
21
View file @
beab7310
...
@@ -56,20 +56,10 @@ Ext.define('App.grid.mixin.ExportLatex', {
...
@@ -56,20 +56,10 @@ Ext.define('App.grid.mixin.ExportLatex', {
"
use strict
"
;
"
use strict
"
;
var
me
=
this
,
var
me
=
this
,
cells
,
cmd
,
columnsAlignment
=
''
,
columnsAlignment
=
''
,
columnHeader
,
columnHeader
,
div
,
i
,
j
,
latex
=
[],
latex
=
[],
nColumns
,
tdEl
,
tdEls
,
trEl
,
trEls
,
trEls
,
row
,
total
;
total
;
// build the column alignment, e.g. llrrc
// build the column alignment, e.g. llrrc
...
@@ -78,9 +68,6 @@ Ext.define('App.grid.mixin.ExportLatex', {
...
@@ -78,9 +68,6 @@ Ext.define('App.grid.mixin.ExportLatex', {
columnsAlignment
+=
value
[
0
];
columnsAlignment
+=
value
[
0
];
});
});
// alias
nColumns
=
columnHeader
.
alignments
.
length
;
// begin table
// begin table
latex
.
push
(
'
\\
begin{longtable}{
'
+
columnsAlignment
+
'
}
'
);
latex
.
push
(
'
\\
begin{longtable}{
'
+
columnsAlignment
+
'
}
'
);
...
@@ -99,15 +86,16 @@ Ext.define('App.grid.mixin.ExportLatex', {
...
@@ -99,15 +86,16 @@ Ext.define('App.grid.mixin.ExportLatex', {
trEls
=
me
.
getView
().
getEl
().
select
(
"
table tr
"
);
trEls
=
me
.
getView
().
getEl
().
select
(
"
table tr
"
);
// process the trEls Ext.dom.CompositeElement
// process the trEls Ext.dom.CompositeElement
for
(
i
=
0
;
i
<
trEls
.
getCount
();
i
+=
1
)
{
trEls
.
each
(
function
(
trEl
,
compositeElement
,
index
)
{
trEl
=
t
r
Els
.
item
(
i
)
;
var
cells
,
cmd
,
div
,
nColumns
,
t
d
Els
,
row
;
// grouping row. It is represent as a latex multicolumn
// grouping row. It is represent as a latex multicolumn
if
(
trEl
.
hasCls
(
"
x-grid-wrap-row
"
))
{
if
(
trEl
.
hasCls
(
"
x-grid-wrap-row
"
))
{
div
=
trEl
.
down
(
"
.x-grid-group-title
"
);
div
=
trEl
.
down
(
"
.x-grid-group-title
"
);
if
(
div
)
{
if
(
div
)
{
nColumns
=
columnHeader
.
alignments
.
length
;
cmd
=
'
\\
multicolumn{
'
+
nColumns
+
'
}{l}{
'
+
me
.
domToLaTeX
(
div
)
+
'
}
\\\\
'
;
cmd
=
'
\\
multicolumn{
'
+
nColumns
+
'
}{l}{
'
+
me
.
domToLaTeX
(
div
)
+
'
}
\\\\
'
;
latex
.
push
(
cmd
);
latex
.
push
(
cmd
);
latex
.
push
(
'
\\
hline
'
);
latex
.
push
(
'
\\
hline
'
);
...
@@ -120,20 +108,20 @@ Ext.define('App.grid.mixin.ExportLatex', {
...
@@ -120,20 +108,20 @@ Ext.define('App.grid.mixin.ExportLatex', {
tdEls
=
trEl
.
select
(
"
td
"
);
tdEls
=
trEl
.
select
(
"
td
"
);
// process the tdEls Ext.dom.CompositeElement
// process the tdEls Ext.dom.CompositeElement
for
(
j
=
0
;
j
<
tdEls
.
getCount
();
j
+=
1
)
{
tdEls
.
each
(
function
(
tdEl
)
{
cells
.
push
(
me
.
domToLaTeX
(
tdEl
s
.
item
(
j
)
));
cells
.
push
(
me
.
domToLaTeX
(
tdEl
));
}
}
,
me
);
row
=
cells
.
join
(
'
&
'
)
+
'
\\\\
'
;
row
=
cells
.
join
(
'
&
'
)
+
'
\\\\
'
;
// unfortunately the grand total
appear a
s the first row (Ext JS 4.2)
// unfortunately the grand total
i
s the first row (Ext JS 4.2)
if
(
i
===
0
&&
trEl
.
hasCls
(
"
x-grid-row-summary
"
))
{
if
(
i
ndex
===
0
&&
trEl
.
hasCls
(
"
x-grid-row-summary
"
))
{
total
=
row
;
total
=
row
;
}
else
{
}
else
{
latex
.
push
(
row
);
latex
.
push
(
row
);
}
}
}
}
}
}
,
me
);
// push the grand total at the end
// push the grand total at the end
if
(
total
)
{
if
(
total
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment