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
9d3dcb66
Commit
9d3dcb66
authored
Oct 21, 2016
by
LE GAC Renaud
Browse files
Remove DictMultiDefault.js.
parent
ee46e174
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
144 deletions
+2
-144
docs/reference/field.rst
docs/reference/field.rst
+0
-1
static/plugin_dbui/CHANGELOG
static/plugin_dbui/CHANGELOG
+2
-0
static/plugin_dbui/src/form/Panel.js
static/plugin_dbui/src/form/Panel.js
+0
-1
static/plugin_dbui/src/form/field/DictMultiDefault.js
static/plugin_dbui/src/form/field/DictMultiDefault.js
+0
-142
No files found.
docs/reference/field.rst
View file @
9d3dcb66
...
...
@@ -183,7 +183,6 @@ Each widget is defined by its ``xtype`` configuration parameters:
ComboBoxUserReset xcomboboxuserreset
Date datefield
Dict xdictfield
DictMultiDefault xdictmultidefault
HtmlEditor htmleditor
List xlistfield
Number numberfield
...
...
static/plugin_dbui/CHANGELOG
View file @
9d3dcb66
--------------------------------- CHANGE LOG ----------------------------------
HEAD
- Fix AceEditor class in order to run with Ext JS 6
- Remove the JavaScript class DictMultiDefault.
0.9.2 (Sep 2016)
- Add the base class Dbui.grid.plugin.ContextMenu
...
...
static/plugin_dbui/src/form/Panel.js
View file @
9d3dcb66
...
...
@@ -31,7 +31,6 @@ Ext.define('Dbui.form.Panel', {
'
Dbui.form.field.ComboBoxSlave
'
,
'
Dbui.form.field.ComboBoxUserReset
'
,
'
Dbui.form.field.Dict
'
,
'
Dbui.form.field.DictMultiDefault
'
,
'
Dbui.form.field.List
'
,
'
Dbui.form.field.TextPicker
'
,
'
Ext.form.field.Date
'
,
...
...
static/plugin_dbui/src/form/field/DictMultiDefault.js
deleted
100644 → 0
View file @
ee46e174
/**
* A dictionary handling several default values.
*
* This field is linked to a ComboBox field. The value selected
* in this comboBox define the default dictionary which has to be used.
*
* @experimental
* @since 0.6.2
*
*/
Ext
.
define
(
'
Dbui.form.field.DictMultiDefault
'
,
{
extend
:
'
Dbui.form.field.Dict
'
,
alias
:
'
widget.xdictmultidefault
'
,
/**
* @cfg {Ext.data.Store/String} store (required)
* the store should a list contains the key, selected by the comboBox,
* and the associated dictionary definition.
*
*/
/**
* @cfg {String} dictField (required)
* The field in the store contain dictionary definition.
*/
/**
* @cfg {String} comboBoxItemId (required)
* The itemId of the comboBox.
*/
// private attributes
combo
:
null
,
lastKey
:
undefined
,
// jshint strict: false
// private method requests by the component model of ExtJS
initComponent
:
function
()
{
var
me
=
this
;
// instantiate the base class
me
.
callParent
(
arguments
);
// instantiate the store containing the relation
// between the key and the dictionary configuration
me
.
store
=
Dbui
.
getStore
(
me
.
store
);
// bind me to the comboBox
me
.
on
(
'
afterrender
'
,
me
.
bindToComboBox
,
me
);
},
// private method requests by the component model of ExtJS
beforeDestroy
:
function
()
{
var
me
=
this
;
me
.
un
(
'
afterrender
'
,
me
.
bindToComboBox
,
me
);
me
.
combo
.
un
(
'
select
'
,
me
.
onComboBoxSelect
,
me
);
me
.
callParent
(
arguments
);
},
//
// Override Dbui.form.field.Dict to store the lastKey.
// The lastKey is the value of the ComboBox when setting
// the value of the DictMultiDefault.
// It is used to reload the original value when changing
// the key.
//
// NOTE: this method is called before the rendering.
// Therefore the ComboBox is linked here.
//
// @param {Object} value
//
// @return {Dbui.form.field.DictMultiDefault}
//
setValue
:
function
(
value
)
{
var
me
=
this
;
// link me to the ComboBox
if
(
value
&&
!
me
.
combo
)
{
if
(
!
me
.
combo
)
{
me
.
combo
=
me
.
up
(
'
xform, form
'
).
down
(
'
#
'
+
me
.
comboBoxItemId
);
}
}
// keep track of the value load in the ComboBox
// replace empty string by empty dictionary
if
(
me
.
combo
)
{
me
.
lastKey
=
me
.
combo
.
getValue
();
if
(
!
value
)
{
value
=
{};
}
}
return
me
.
callParent
([
value
]);
},
// jshint strict: true
//
// Bind the ComboBox and the Dict field.
// The handler is triggered by the afterrender event.
//
bindToComboBox
:
function
()
{
"
use strict
"
;
var
me
=
this
;
me
.
combo
=
me
.
up
(
'
xform, form
'
).
down
(
'
#
'
+
me
.
comboBoxItemId
);
me
.
combo
.
on
(
'
select
'
,
me
.
onComboBoxSelect
,
me
);
},
//
// Handle the ComboBox select event
//
// @param {Ext.form.field.ComboBox} combo
// @param {Ext.data.Model} record
// @param {Object} eOpts
//
onComboBoxSelect
:
function
(
combo
,
record
)
{
"
use strict
"
;
var
me
=
this
;
me
.
originalValue
=
record
.
get
(
me
.
dictField
);
// load the current value if the key is back to the original one
if
(
combo
.
getValue
()
===
me
.
lastKey
)
{
me
.
grid
.
setSource
(
me
.
value
);
// load default value
}
else
{
me
.
grid
.
setSource
(
me
.
originalValue
);
}
}
});
\ No newline at end of file
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