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
68bd0328
Commit
68bd0328
authored
11 years ago
by
legac
Browse files
Options
Downloads
Patches
Plain Diff
ExtJS 4.2: Migrate the ComboBox.
parent
88fa7af5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
models/widgets_viewport.py
+10
-0
10 additions, 0 deletions
models/widgets_viewport.py
static/plugin_dbui/locale/dbui-lang-fr.js
+7
-0
7 additions, 0 deletions
static/plugin_dbui/locale/dbui-lang-fr.js
static/plugin_dbui/src/combobox.js
+19
-11
19 additions, 11 deletions
static/plugin_dbui/src/combobox.js
with
36 additions
and
11 deletions
models/widgets_viewport.py
+
10
−
0
View file @
68bd0328
...
...
@@ -19,8 +19,18 @@ categoriesLeaf = dbui.Window(closable=True,
autoHeight
=
True
,
widht
=
500
)
harvestersLeaf
=
dbui
.
Window
(
closable
=
True
,
anchor
=
'
100%
'
,
items
=
[
dbui
.
to_formPanel
(
db
[
'
harvesters
'
])],
title
=
"
Add harvester ...
"
,
defaults
=
{
'
anchor
'
:
'
90%
'
},
modal
=
True
,
autoHeight
=
True
,
widht
=
500
)
formNode
=
dbui
.
Node
(
T
(
'
Forms
'
))
formNode
.
add_child
(
T
(
"
categories
"
),
categoriesLeaf
)
formNode
.
add_child
(
T
(
"
harvesters
"
),
harvestersLeaf
)
#
# the grid node
...
...
This diff is collapsed.
Click to expand it.
static/plugin_dbui/locale/dbui-lang-fr.js
+
7
−
0
View file @
68bd0328
...
...
@@ -10,6 +10,13 @@ if (App.BasePanelWithSelector) {
});
}
if
(
App
.
form
.
field
.
ComboBox
)
{
Ext
.
apply
(
App
.
form
.
field
.
ComboBox
.
prototype
,
{
textSelect
:
'
Sélectioner un(e)
'
,
});
}
if
(
App
.
form
.
DictField
)
{
Ext
.
apply
(
App
.
form
.
DictField
.
prototype
,
{
textAdd
:
'
Ajouter
'
,
...
...
This diff is collapsed.
Click to expand it.
static/plugin_dbui/src/combobox.js
+
19
−
11
View file @
68bd0328
/**
* The ComboBox is an Ext.form.ComboBox linked to an App.data.DirectStore.
* This is Ext.form.field.ComboBox linked to a database table.
*
* The store attribute is equal the table name when the widget
* is configured. It is replaced by an Ext.data.store.Direct
* in the initialization phase of the component.
*
*/
Ext
.
define
(
'
App.form.ComboBox
'
,
{
Ext
.
define
(
'
App.form.
field.
ComboBox
'
,
{
extend
:
'
Ext.form.ComboBox
'
,
extend
:
'
Ext.form.
field.
ComboBox
'
,
alias
:
'
widget.xcombobox
'
,
// Predefined setting
mode
:
'
remote
'
,
editable
:
false
,
selectOnFocus
:
true
,
// Works in auto completion mode when the user type value.
// In any case the value should belongs to the list.
editable
:
true
,
forceSelection
:
true
,
queryMode
:
'
local
'
,
triggerAction
:
'
all
'
,
typeAhead
:
true
,
// private properties for internationalization
textSelect
:
'
Select a
'
,
// private method require by the ExtJs component model
initComponent
:
function
()
{
...
...
@@ -21,14 +29,14 @@ Ext.define('App.form.ComboBox', {
// defined the empty text from the field label
if
(
this
.
fieldLabel
&&
!
this
.
emptyText
)
{
this
.
emptyText
=
"
Select
a
"
+
this
.
fieldLabel
+
"
...
"
;
this
.
emptyText
=
this
.
text
Select
+
this
.
fieldLabel
+
"
...
"
;
}
// link the
c
ombo
b
ox to the data store
// link the
C
ombo
B
ox to the data store
this
.
store
=
App
.
getStore
(
this
.
store
);
// construct the underlying class.
DON'T MOVE
App
.
form
.
ComboBox
.
superclass
.
initComponent
.
call
(
this
);
// construct the underlying class.
App
.
form
.
field
.
ComboBox
.
superclass
.
initComponent
.
call
(
this
);
// load the store if not yet done
if
(
this
.
store
.
getCount
()
===
0
)
{
...
...
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