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
8bec2477
Commit
8bec2477
authored
8 years ago
by
LE GAC Renaud
Browse files
Options
Downloads
Patches
Plain Diff
Update WithUrlSelector.js to use Dbui.getFields.
parent
18ad2ef1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!36
Release 0.9.7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
static/plugin_dbui/src/panel/WithUrlSelector.js
+24
-34
24 additions, 34 deletions
static/plugin_dbui/src/panel/WithUrlSelector.js
with
24 additions
and
34 deletions
static/plugin_dbui/src/panel/WithUrlSelector.js
+
24
−
34
View file @
8bec2477
...
...
@@ -142,29 +142,29 @@ Ext.define('Dbui.panel.WithUrlSelector', {
"
use strict
"
;
var
me
=
this
,
i
,
fields
,
fieldName
,
fieldValue
,
li
,
fName
,
url
=
{
vars
:
{}
};
url
;
function
extract
(
key
,
subfield
)
{
url
.
vars
[
subfield
.
getName
()]
=
subfield
.
getValue
();
}
// instantiate the url object
url
=
{
vars
:
{}
};
fields
=
me
.
selec
t
orPanel
.
query
(
'
field
'
);
for
(
i
=
0
;
i
<
fields
.
length
;
i
+=
1
)
{
// scan all descendant fields embedded in the
selecor
Panel
Dbui
.
getFields
(
me
.
selectorPanel
).
forEach
(
function
(
field
)
{
fieldName
=
fields
[
i
].
getName
();
fieldValue
=
fields
[
i
].
getValue
();
var
fieldName
,
fieldValue
,
fName
,
fieldsToJson
;
// the field name is encode TableField
li
=
Dbui
.
decodeCapitalizeWords
(
fieldName
);
fName
=
li
[
1
];
fieldName
=
field
.
getName
();
fieldValue
=
field
.
getValue
();
// JSON encoding
fieldsToJson
=
[
"
xdictfield
"
,
"
xlistfield
"
,
"
xtablefield
"
];
if
(
fieldsToJson
.
indexOf
(
field
.
getXType
())
!==
-
1
)
{
fieldValue
=
Ext
.
JSON
.
encode
(
fieldValue
);
}
// extract the field name from its encoded form, TableField
fName
=
Dbui
.
decodeCapitalizeWords
(
fieldName
)[
1
];
switch
(
fName
)
{
...
...
@@ -184,13 +184,7 @@ Ext.define('Dbui.panel.WithUrlSelector', {
url
.
vars
[
fieldName
]
=
fieldValue
;
break
;
}
}
// complete URL parameters with those embedded in composite fields
fields
=
me
.
selectorPanel
.
query
(
'
fieldcontainer
'
);
for
(
i
=
0
;
i
<
fields
.
length
;
i
+=
1
)
{
fields
[
i
].
items
.
eachKey
(
extract
);
}
});
// build the URL
url
.
http
=
me
.
baseUrl
;
...
...
@@ -290,15 +284,11 @@ Ext.define('Dbui.panel.WithUrlSelector', {
onReset
:
function
()
{
"
use strict
"
;
var
me
=
this
;
var
me
=
this
,
fields
,
i
;
fields
=
me
.
selectorPanel
.
query
(
'
field
'
);
for
(
i
=
0
;
i
<
fields
.
length
;
i
+=
1
)
{
fields
[
i
].
reset
();
}
Dbui
.
getFields
(
me
.
selectorPanel
).
forEach
(
function
(
field
)
{
field
.
reset
();
});
},
/**
...
...
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