WIP, updates dropdown datatype so it supports updates to key value prevalue editor
[TFS Changeset #80221]
This commit is contained in:
@@ -17,7 +17,7 @@ namespace umbraco.editorControls.dropdownlist
|
||||
{
|
||||
if (_Editor == null)
|
||||
{
|
||||
_Editor = new dropdown(Data,((KeyValuePrevalueEditor)PrevalueEditor).Prevalues);
|
||||
_Editor = new dropdown(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList);
|
||||
}
|
||||
return _Editor;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace umbraco.editorControls.dropdownlist
|
||||
{
|
||||
if (_Editor == null)
|
||||
{
|
||||
_Editor = new dropdown(Data,((KeyValuePrevalueEditor)PrevalueEditor).Prevalues);
|
||||
_Editor = new dropdown(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList);
|
||||
}
|
||||
return _Editor;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections;
|
||||
|
||||
using umbraco.cms.businesslogic;
|
||||
using umbraco.cms.businesslogic.language;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace umbraco.editorControls
|
||||
{
|
||||
@@ -20,6 +21,15 @@ namespace umbraco.editorControls
|
||||
_prevalues = Prevalues;
|
||||
}
|
||||
|
||||
|
||||
List<KeyValuePair<int, String>> Prevalues;
|
||||
public dropdown(interfaces.IData Data, List<KeyValuePair<int, String>> Prevalues)
|
||||
{
|
||||
_data = Data;
|
||||
this.Prevalues = Prevalues;
|
||||
}
|
||||
|
||||
|
||||
public Control Editor {
|
||||
get {return this;}
|
||||
}
|
||||
@@ -44,10 +54,23 @@ namespace umbraco.editorControls
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit (e);
|
||||
foreach (object key in _prevalues.Keys)
|
||||
|
||||
if (_prevalues != null)
|
||||
{
|
||||
this.Items.Add(new ListItem(dropdown.DictionaryReplace(_prevalues[key].ToString()), key.ToString()));
|
||||
}
|
||||
foreach (object key in _prevalues.Keys)
|
||||
{
|
||||
this.Items.Add(new ListItem(dropdown.DictionaryReplace(_prevalues[key].ToString()), key.ToString()));
|
||||
}
|
||||
|
||||
}
|
||||
else if (Prevalues != null)
|
||||
{
|
||||
foreach (KeyValuePair<int, String> item in Prevalues)
|
||||
{
|
||||
this.Items.Add(new ListItem(dropdown.DictionaryReplace(item.Value), item.Key.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
base.Items.Insert(0, new ListItem(ui.Text("choose") + "...",""));
|
||||
|
||||
if (_data != null && _data.Value != null)
|
||||
|
||||
Reference in New Issue
Block a user