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
a629dec1
Commit
a629dec1
authored
9 years ago
by
LE GAC Renaud
Browse files
Options
Downloads
Patches
Plain Diff
Run the jslint checker.
parent
34c3ce7b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!6
Master
,
!5
7 preferences
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
static/plugin_dbui/src/grid/property/Preferences.js
+15
-19
15 additions, 19 deletions
static/plugin_dbui/src/grid/property/Preferences.js
with
15 additions
and
19 deletions
static/plugin_dbui/src/grid/property/Preferences.js
+
15
−
19
View file @
a629dec1
...
@@ -11,7 +11,7 @@ Ext.define('App.grid.property.Preferences', {
...
@@ -11,7 +11,7 @@ Ext.define('App.grid.property.Preferences', {
alias
:
'
widget.xpreferences
'
,
alias
:
'
widget.xpreferences
'
,
/**
/**
* @cfg {String} dbtable
* @cfg {String} dbtable
(required)
* The database table containing the property and their values
* The database table containing the property and their values
*/
*/
dbtable
:
"
preferences
"
,
dbtable
:
"
preferences
"
,
...
@@ -55,7 +55,7 @@ Ext.define('App.grid.property.Preferences', {
...
@@ -55,7 +55,7 @@ Ext.define('App.grid.property.Preferences', {
minWidth
:
80
,
minWidth
:
80
,
text
:
me
.
textUpdate
,
text
:
me
.
textUpdate
,
scope
:
me
scope
:
me
},{
},
{
handler
:
me
.
onButtonReset
,
handler
:
me
.
onButtonReset
,
minWidth
:
80
,
minWidth
:
80
,
text
:
me
.
textReset
,
text
:
me
.
textReset
,
...
@@ -76,8 +76,6 @@ Ext.define('App.grid.property.Preferences', {
...
@@ -76,8 +76,6 @@ Ext.define('App.grid.property.Preferences', {
// initialise the base class
// initialise the base class
me
.
callParent
(
arguments
);
me
.
callParent
(
arguments
);
// link the buttons
// load the store and fill the grid property
// load the store and fill the grid property
me
.
refStore
.
load
({
me
.
refStore
.
load
({
callback
:
me
.
onRefStoreLoad
,
callback
:
me
.
onRefStoreLoad
,
...
@@ -89,19 +87,19 @@ Ext.define('App.grid.property.Preferences', {
...
@@ -89,19 +87,19 @@ Ext.define('App.grid.property.Preferences', {
* load the store and fill the grid property
* load the store and fill the grid property
*
*
*/
*/
onRefStoreLoad
:
function
(
records
,
operation
,
success
)
{
onRefStoreLoad
:
function
(
records
,
operation
,
success
)
{
"
use strict
"
;
"
use strict
"
;
var
me
=
this
,
var
me
=
this
,
data
=
{},
data
=
{};
i
,
property
,
value
;
for
(
i
=
0
;
i
<
records
.
length
;
i
+=
1
)
{
records
.
forEach
(
function
(
record
)
{
property
=
records
[
i
].
get
(
me
.
fieldProperty
);
var
property
,
value
;
value
=
records
[
i
].
get
(
me
.
fieldValue
);
property
=
record
.
get
(
me
.
fieldProperty
);
value
=
record
.
get
(
me
.
fieldValue
);
data
[
property
]
=
value
;
data
[
property
]
=
value
;
}
}
);
me
.
setSource
(
data
,
me
.
sourceConfig
);
me
.
setSource
(
data
,
me
.
sourceConfig
);
},
},
...
@@ -125,17 +123,15 @@ Ext.define('App.grid.property.Preferences', {
...
@@ -125,17 +123,15 @@ Ext.define('App.grid.property.Preferences', {
"
use strict
"
;
"
use strict
"
;
var
me
=
this
,
var
me
=
this
,
data
=
me
.
getSource
(),
data
=
me
.
getSource
(),
i
,
newValue
,
oldValue
,
properties
,
record
;
properties
=
Object
.
keys
(
data
);
// the list of property
properties
=
Object
.
keys
(
data
);
// find the record associate to each property
// find the record associate to each property
// update it if necessarily
// update it if necessarily
for
(
i
=
0
;
i
<
properties
.
length
;
i
+=
1
)
{
properties
.
forEach
(
function
(
property
)
{
record
=
me
.
refStore
.
findRecord
(
me
.
fieldProperty
,
properties
[
i
]);
var
newValue
,
oldValue
,
record
;
record
=
me
.
refStore
.
findRecord
(
me
.
fieldProperty
,
property
);
newValue
=
data
[
propert
ies
[
i
]
];
newValue
=
data
[
propert
y
];
oldValue
=
record
.
get
(
me
.
fieldValue
);
oldValue
=
record
.
get
(
me
.
fieldValue
);
if
(
newValue
!==
oldValue
)
{
if
(
newValue
!==
oldValue
)
{
...
@@ -143,7 +139,7 @@ Ext.define('App.grid.property.Preferences', {
...
@@ -143,7 +139,7 @@ Ext.define('App.grid.property.Preferences', {
record
.
set
(
me
.
fieldValue
,
newValue
);
record
.
set
(
me
.
fieldValue
,
newValue
);
record
.
endEdit
();
record
.
endEdit
();
}
}
}
}
);
// close the window housing the preferences widget
// close the window housing the preferences widget
// simple logic based on the owner container
// simple logic based on the owner container
...
...
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