Add read-only taglist

This commit is contained in:
Nathan Gray
2013-11-25 18:10:48 +00:00
parent 84420db6ea
commit a5227f2359
3 changed files with 40 additions and 9 deletions

View File

@@ -807,15 +807,11 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM],
}
}
// Allow some special extras for objects by passing the whole thing - value might not be key
if(typeof _options[key] == 'object' && _options[key] != null && typeof _options[key].value != 'undefined' && _options[key].value != key)
{
// Use value, not key, so it goes into the right place
this.optionValues[_options[key].value] = _options[key];
}
else
{
this.optionValues[key] = _options[key];
var option_id = _options[key].value || _options[key].id || key;
if(option_id != key) {
egw.debug('log', 'Options not indexed. TODO: what is up?', this);
}
this.optionValues[option_id] = _options[key];
}
},
@@ -842,7 +838,9 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM],
// Not a valid option
continue;
}
this.span.append("<li>"+option+"</li>");
$j("<li>"+option+"</li>")
.attr('data-value', _value[i])
.appendTo(this.span);
}
}
return;