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
c77a6108
Commit
c77a6108
authored
Dec 17, 2011
by
Renaud Le Gac
Browse files
Create a new widget PanelWithSelector and fix minor typo in
gridwithfilter.
parent
79d3bf6a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
136 additions
and
36 deletions
+136
-36
controllers/reports.py
controllers/reports.py
+8
-1
modules/plugin_dbui/navtree.py
modules/plugin_dbui/navtree.py
+20
-32
static/plugin_dbui/locale/app-lang-fr.js
static/plugin_dbui/locale/app-lang-fr.js
+8
-1
static/plugin_dbui/src/appgridwithfilter.js
static/plugin_dbui/src/appgridwithfilter.js
+2
-2
static/plugin_dbui/src/apppanelwithselector.js
static/plugin_dbui/src/apppanelwithselector.js
+98
-0
No files found.
controllers/reports.py
View file @
c77a6108
...
...
@@ -35,4 +35,11 @@ def report_1():
db
.
publications
.
conference_title
,
db
.
categories
.
code
)
return
{
'title'
:
'Rapport 1'
,
'publis'
:
rows
}
\ No newline at end of file
return
{
'title'
:
'Rapport 1'
,
'publis'
:
rows
}
def
report_2
():
"""Return the url arguments
"""
return
'report_2: '
+
str
(
request
.
args
)
\ No newline at end of file
modules/plugin_dbui/navtree.py
View file @
c77a6108
...
...
@@ -10,51 +10,39 @@ from gluon import current
def
cfg_configurable_url_panel
(
key
,
value
):
""" Return the configuration dictionary for a panel displaying
an url. The argument of the url can be change using a form
appearing on the right side.
an URL. The argument of the URL can be change using a form
appearing on the right side. The form is defined by a table
of the dummy database.
The ExtJS widget behind the scene is App.panel.PanelWithConfigurator.
Technicaly, the configuration dictionary describe an ExtJS.Viewport
key
it the name of the leaf
value
dictionary containing
url
its content is displayed in the panel
form
an xxx form allowing to customize the url request
It is displaied on the right side of the panel
tuple containing a well form URL string
and a gluon.dal.Table build the form allowing to setup
the URL arguments
"""
cfg
=
{
'layout'
:
'border'
,
'items'
:
[{
'autoScroll'
:
True
,
'defaults'
:
{
'layout'
:
'fit'
},
'itemId'
:
'urlPanel'
,
'region'
:
'center'
,
},
{
'autoScroll'
:
True
,
'buttons'
:
[{
'text'
:
'Go'
,
}],
'collapsible'
:
True
,
'frame'
:
True
,
'layout'
:
'form'
,
'itemId'
:
'urlConfigurator'
,
'region'
:
'east'
,
'split'
:
True
,
'width'
:
200
,
}]
}
url
,
table
=
value
cfg
=
{
'panelCfg'
:
None
,
'selectorCfg'
:
None
,
'xtype'
:
'xpanelwithselector'
}
cfg
[
'panelCfg'
]
=
{
'baseUrl'
:
url
,
'plugins'
:
[
'pPanelMathJax'
],
'preventBodyReset'
:
True
}
cfg
[
'selectorCfg'
]
=
{}
return
cfg
def
cfg_url_panel
(
key
,
url
):
"""Return the configuration dictionary for an Ext.Panel
displaying an
url
.
displaying an
URL
.
key
it the name of the leaf
...
...
static/plugin_dbui/locale/app-lang-fr.js
View file @
c77a6108
...
...
@@ -47,4 +47,11 @@ if (App.grid.RowEditorContextMenu) {
textUpdate
:
'
Actualiser
'
,
textView
:
'
Voir
'
});
}
\ No newline at end of file
}
if
(
App
.
panel
.
PanelWithSelector
)
{
Ext
.
apply
(
App
.
panel
.
PanelWithSelector
.
prototype
,
{
textGo
:
'
Go
'
,
textReset
:
'
Annuler
'
,
});
}
static/plugin_dbui/src/appgridwithfilter.js
View file @
c77a6108
/**
* A border layout with a grid and its filter
*
* The type of this component is xgridwithfilter.
*
* @extend: Ext.Panel
...
...
@@ -27,7 +26,8 @@ App.grid.GridWithFilter = Ext.extend(Ext.Panel, {
*/
constructor
:
function
(
config
)
{
var
filter
,
var
cfg
,
filter
,
grid
;
Ext
.
apply
(
this
,
config
);
...
...
static/plugin_dbui/src/apppanelwithselector.js
0 → 100644
View file @
c77a6108
/**
* A border layout with a panel and an url selector
* The type of this component is xpanelwithselector.
*
* @extend: Ext.Panel
*
*/
Ext
.
namespace
(
'
App.panel
'
);
App
.
panel
.
PanelWithSelector
=
Ext
.
extend
(
Ext
.
Panel
,
{
/**
* @param {String} base url to be displayed in the panel
*/
panelCfg
:
null
,
selectorCfg
:
null
,
/**
* Private attribute for internationalization
*/
textGo
:
'
Go
'
,
textReset
:
'
Reset
'
,
/**
* constructor
* @param {Object} config
*/
constructor
:
function
(
config
){
var
cfg
;
// predefined configuration of the panel
cfg
=
{
layout
:
'
border
'
,
items
:
[{
autoScroll
:
true
,
border
:
false
,
defaults
:
{
layout
:
'
fit
'
},
itemId
:
'
urlPanel
'
,
region
:
'
center
'
,
},
{
autoScroll
:
true
,
buttons
:
[{
ref
:
'
../../goButton
'
,
text
:
this
.
textGo
},
{
ref
:
'
../../resetButton
'
,
text
:
this
.
textReset
}],
collapsible
:
true
,
frame
:
true
,
layout
:
'
form
'
,
itemId
:
'
urlConfigurator
'
,
region
:
'
east
'
,
split
:
true
,
width
:
200
,
}]
};
// apply user panel configuration
Ext
.
apply
(
cfg
,
config
.
panelCfg
);
// apply user selector cnonfiguration
Ext
.
apply
(
cfg
,
config
.
selectorCfg
);
// instanciate the panel
Ext
.
apply
(
this
,
cfg
);
App
.
panel
.
PanelWithSelector
.
superclass
.
constructor
.
call
(
this
);
// handlers
this
.
goButton
.
on
(
'
click
'
,
this
.
onGo
,
this
);
},
/**
* handle to build the URL and to load it in the panel
*/
onGo
:
function
()
{
var
urlconfigurator
=
this
.
getComponent
(
'
urlConfigurator
'
),
urlPanel
=
this
.
getComponent
(
'
urlPanel
'
);
// buil the url
// load the url in the panel
console
.
log
(
'
onGo
'
,
this
.
baseUrl
,
urlPanel
);
urlPanel
.
load
({
url
:
this
.
baseUrl
,
text
:
'
Loading...
'
,
timeout
:
30
});
}
});
Ext
.
reg
(
'
xpanelwithselector
'
,
App
.
panel
.
PanelWithSelector
);
\ No newline at end of file
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