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
tev
plugin_event
Commits
7d937d6d
Commit
7d937d6d
authored
Mar 14, 2017
by
LE GAC Renaud
Browse files
Redesign the grid2 view in order to destroy poperly temporarely objects.
parent
f97f81b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
20 deletions
+46
-20
views/plugin_event/grid2.html
views/plugin_event/grid2.html
+46
-20
No files found.
views/plugin_event/grid2.html
View file @
7d937d6d
...
...
@@ -9,19 +9,15 @@
#--------------------------------------------------------------------------
# Prepare the data
# - The HTML tilte
# - The DIV blocks
# - Export python variables to javascript
#--------------------------------------------------------------------------
import json
from datetime import datetime
#
# The title
and the DIV block
# The title
#
divgrid = "grid-%s" % id(cfg_store)
response.write(H2(title, _class="dbui-h2 dbui-small-cap"))
response.write(DIV(_id=divgrid))
title = H2(title, _class="dbui-h2 dbui-small-cap")
#
# Convert store and grid configuration as string
...
...
@@ -40,37 +36,67 @@
"margin-bottom: 3ex;",
"margin-top: 2ex;"]
response.write(
P(delta, _style="".join(style))
)
delta =
P(delta, _style="".join(style))
}}
<script
type=
"text/javascript"
>
var
cfgGrid
=
{{
=
XML
(
cfg_grid
)}},
cfgStore
=
{{
=
XML
(
cfg_store
)}},
columns
=
cfgGrid
.
columns
,
features
=
cfgGrid
.
features
,
divgrid
=
'
{{=divgrid}}
'
,
nColumns
=
columns
.
length
,
i
,
grid
;
footer
,
header
,
main
,
tabPanel
;
// instantiate the grid
//
// Retrieve the mainPanel which will embedded the grid
// viewport > tabpanel > tab[active] > panelwithurlselector > mainPanel
//
tabPanel
=
Ext
.
ComponentQuery
.
query
(
"
xviewport > tabpanel
"
)[
0
];
main
=
tabPanel
.
getActiveTab
().
down
(
"
xpanelwithurlselector #mainPanel
"
);
// NOTE ExtJS 6.2.0
// With ExtJS 6.2.0, the configuration is not working:
//
// plugins: ['pGridExport', 'pMathJax']
// remove all embeded object
// Avoid proliferation of useless object
// Keep the memory foot print low
//
// It is related to layout and pMathJax !
// Remove pMathJax since its use is marginal in that application.
main
.
removeAll
(
true
);
//
// configure the header
//
header
=
{
border
:
false
,
html
:
'
{{=title}}
'
,
xtype
:
"
panel
"
};
//
// configure the grid
//
cfgGrid
=
Ext
.
apply
(
cfgGrid
,
{
plugins
:
[
'
pGridExport
'
],
store
:
cfgStore
,
forceFit
:
true
,
padding
:
"
10 40 20 30
"
,
renderTo
:
div
grid
xtype
:
"
x
grid
"
});
Ext
.
create
(
'
Dbui.grid.Panel
'
,
cfgGrid
);
//
// configure the footer
//
footer
=
{
border
:
false
,
html
:
'
{{=delta}}
'
,
xtype
:
"
panel
"
};
//
// Add sub-panels to the main one
//
main
.
add
({
border
:
false
,
items
:
[
header
,
cfgGrid
,
footer
],
layout
:
"
anchor
"
,
scrollable
:
true
,
xtype
:
"
panel
"
});
</script>
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