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
b98d29b2
Commit
b98d29b2
authored
14 years ago
by
Renaud Le Gac
Browse files
Options
Downloads
Patches
Plain Diff
Redesign the get_grid method.
parent
2246e6b1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/plugin_dbui/cfgsvc.py
+18
-30
18 additions, 30 deletions
modules/plugin_dbui/cfgsvc.py
with
18 additions
and
30 deletions
modules/plugin_dbui/cfgsvc.py
+
18
−
30
View file @
b98d29b2
...
...
@@ -32,11 +32,13 @@ FTYPE_TO_XTYPE = {'boolean': {'xtype': 'checkbox'},\
# constant defining a store
ROOT
=
'
records
'
STORE
_
ID
=
'
%sStore
'
STOREID
=
'
%sStore
'
SUCCESS
=
'
success
'
TOTAL
=
'
count
'
class
CfgSvc
(
BaseSvc
):
"""
The configuration service which build the configuration options
for the ExtJS widget.
...
...
@@ -468,10 +470,9 @@ class CfgSvc(BaseSvc):
"""
T
=
self
.
environment
[
'
T
'
]
cfg
=
{
'
xtype
'
:
'
xentry
'
,
'
tableName
'
:
tablename
,
'
tableTitle
'
:
str
(
T
(
tablename
.
title
())),
'
items
'
:
self
.
_get_form_items
(
tablename
)}
cfg
=
{
'
items
'
:
self
.
_get_form_items
(
tablename
),
'
store
'
:
self
.
get_jsonstore
(
tablename
),
'
xtype
'
:
'
xform
'
}
form_modifiers
=
self
.
environment
[
'
plugins
'
].
dbui
.
form_modifiers
if
tablename
in
form_modifiers
:
...
...
@@ -496,13 +497,13 @@ class CfgSvc(BaseSvc):
base_params
=
{
'
tableName
'
:
tablename
,
'
dbFields
'
:
[]}
cfg
=
{
'
autoLoad
'
:
True
,
'
autoSave
'
:
Fals
e
,
'
autoSave
'
:
Tru
e
,
'
baseParams
'
:
base_params
,
'
fields
'
:
[],
'
idProperty
'
:
encode_field
(
tablename
,
'
id
'
),
'
root
'
:
ROOT
,
'
successProperty
'
:
SUCCESS
,
'
storeId
'
:
STORE
_
ID
%
tablename
,
'
storeId
'
:
STOREID
%
tablename
,
'
totalProperty
'
:
TOTAL
,
'
xtype
'
:
'
xdirectstore
'
}
...
...
@@ -557,36 +558,23 @@ class CfgSvc(BaseSvc):
"""
T
=
self
.
environment
[
'
T
'
]
di
=
{
'
xtype
'
:
'
grid
'
,
'
frame
'
:
False
,
'
viewConfig
'
:
{
'
forceFit
'
:
True
}}
formModel
=
{
'
xtype
'
:
'
xform
'
,
'
items
'
:
self
.
_get_form_items
(
tablename
)}
form_modifiers
=
self
.
environment
[
'
plugins
'
].
dbui
.
form_modifiers
if
tablename
in
form_modifiers
:
formModel
.
update
(
form_modifiers
[
tablename
].
extjs
)
di
[
'
columns
'
]
=
self
.
_get_columns_model
(
tablename
)
di
[
'
formModel
'
]
=
formModel
cfg
=
{
'
columns
'
:
self
.
_get_columns_model
(
tablename
),
'
frame
'
:
False
,
'
formCfg
'
:
self
.
get_form
(
tablename
),
'
store
'
:
self
.
get_jsonstore
(
tablename
),
'
viewConfig
'
:
{
'
forceFit
'
:
True
},
'
xtype
'
:
'
grid
'
}
filter
=
self
.
_get_grid_filter
(
tablename
)
if
filter
:
di
[
'
filterModel
'
]
=
filter
# di['store'] = STORE_ID % tablename
di
[
'
store
'
]
=
self
.
get_jsonstore
(
tablename
)
# di['tableName'] = tablename
di
[
'
title
'
]
=
T
(
tablename
.
title
())
cfg
[
'
filterModel
'
]
=
filter
# handle the user configuration option for Ext.grid.GridPanel
grid_modifiers
=
self
.
environment
[
'
plugins
'
].
dbui
.
grid_modifiers
if
tablename
in
grid_modifiers
:
di
.
update
(
grid_modifiers
[
tablename
].
extjs
)
cfg
.
update
(
grid_modifiers
[
tablename
].
extjs
)
return
di
return
cfg
def
get_viewport
(
self
):
...
...
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