mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 12:21:26 +02:00
- Keep internal value synced with widget value
- Handle case when rows attribute is specified, and rows legacy option is used for empty_label
This commit is contained in:
parent
c1a7b2de01
commit
f29d9ce72d
@ -66,6 +66,12 @@ var et2_selectbox = et2_inputWidget.extend({
|
|||||||
this.input = null;
|
this.input = null;
|
||||||
this.value = '';
|
this.value = '';
|
||||||
|
|
||||||
|
// Grab value if already available
|
||||||
|
if(typeof this.options.value != 'undefined')
|
||||||
|
{
|
||||||
|
this.value = this.options.value;
|
||||||
|
}
|
||||||
|
|
||||||
// Allow no other widgets inside this one
|
// Allow no other widgets inside this one
|
||||||
this.supportedWidgetClasses = [];
|
this.supportedWidgetClasses = [];
|
||||||
|
|
||||||
@ -351,6 +357,17 @@ var et2_selectbox = et2_inputWidget.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
loadFromXML: function(_node) {
|
loadFromXML: function(_node) {
|
||||||
|
// Handle special case where legacy option for empty label is used (conflicts with rows), and rows is set as an attribute
|
||||||
|
var legacy;
|
||||||
|
if(legacy = _node.getAttribute("options"))
|
||||||
|
{
|
||||||
|
var legacy = legacy.split(",");
|
||||||
|
if(legacy.length && isNaN(legacy[0]))
|
||||||
|
{
|
||||||
|
this.options.empty_label = legacy[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Read the option-tags
|
// Read the option-tags
|
||||||
var options = et2_directChildrenByTagName(_node, "options");
|
var options = et2_directChildrenByTagName(_node, "options");
|
||||||
for (var i = 0; i < options.length; i++)
|
for (var i = 0; i < options.length; i++)
|
||||||
@ -506,12 +523,13 @@ var et2_selectbox = et2_inputWidget.extend({
|
|||||||
{
|
{
|
||||||
var value = [];
|
var value = [];
|
||||||
jQuery("input:checked",this.multiOptions).each(function(){value.push(this.value);});
|
jQuery("input:checked",this.multiOptions).each(function(){value.push(this.value);});
|
||||||
return value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return this._super.apply(this, arguments);
|
this.value = this._super.apply(this, arguments);
|
||||||
}
|
}
|
||||||
|
return this.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user