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
08ded6da
Commit
08ded6da
authored
May 08, 2017
by
LE GAC Renaud
Browse files
Update Ext.form.Panel to fix a bug in setAction#create.
parent
ad3380aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
static/plugin_dbui/src/form/Panel.js
static/plugin_dbui/src/form/Panel.js
+17
-12
No files found.
static/plugin_dbui/src/form/Panel.js
View file @
08ded6da
...
...
@@ -327,26 +327,31 @@ Ext.define('Dbui.form.Panel', {
// load an empty record filled with default values
// NOTE ExtJS 6
.0.1
// - The method record.getData() contains the value the fiel
s i
d
// and for the field with default value but not for the others.
// NOTE ExtJS 6
x
// - The method record.getData() contains the value
for
the field
//
id
and for the field with default value but not for the others.
// - The form can contain values for the other fields due to
// previous operation. The previous values are not overwritten
// by the metho
s
form.loadRecord or form.setValues.
// by the metho
d
form.loadRecord or form.setValues.
// - The solution is to defined a data block with values for
// all fields and toload it using form.setValues.
// -
The form.reset is required to remove non
valid f
lags.
// all fields and to
load it using form.setValues.
// -
Clear in
valid f
ield
newRecord
=
me
.
store
.
getProxy
().
getModel
().
create
();
data
=
{};
fields
=
newRecord
.
getFields
()
;
for
(
i
=
0
;
i
<
fields
.
length
;
i
+=
1
)
{
name
=
fields
[
i
]
.
get
N
ame
(
);
data
[
name
]
=
newRecord
.
get
(
name
);
}
newRecord
.
getFields
()
.
forEach
(
function
(
field
)
{
var
name
=
field
.
getName
();
data
[
name
]
=
newRecord
.
get
(
n
ame
);
}
);
form
.
setValues
(
data
);
form
.
reset
();
form
.
getFields
().
each
(
function
(
field
)
{
field
.
clearInvalid
();
return
true
;
});
break
;
case
'
destroy
'
:
...
...
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