Binding in ContentType editor (#7886)

Change the prefix so that binding does not care whether parts are in a different order in the type definition
This commit is contained in:
Matteo Piovanelli
2017-10-26 21:14:42 +02:00
committed by Sébastien Ros
parent 3152bb131a
commit 584ba97b27
2 changed files with 4 additions and 4 deletions

View File

@@ -19,7 +19,7 @@ namespace Orchard.ContentTypes.ViewModels {
}
public int Index { get; set; }
public string Prefix { get { return "Fields[" + Index + "]"; } }
public string Prefix { get { return "Fields[" + Name + "]"; } }
public EditPartViewModel Part { get; set; }
public string Name { get; set; }
@@ -29,4 +29,4 @@ namespace Orchard.ContentTypes.ViewModels {
public SettingsDictionary Settings { get; set; }
public ContentPartFieldDefinition _Definition { get; private set; }
}
}
}

View File

@@ -17,7 +17,7 @@ namespace Orchard.ContentTypes.ViewModels {
}
public int Index { get; set; }
public string Prefix { get { return "Parts[" + Index + "]"; } }
public string Prefix { get { return "Parts[" + PartDefinition.Name + "]"; } }
public EditPartViewModel PartDefinition { get; set; }
public SettingsDictionary PartSettings { get; set; }
public SettingsDictionary Settings { get; set; }
@@ -29,4 +29,4 @@ namespace Orchard.ContentTypes.ViewModels {
get { return PartSettings.ContainsKey("ContentPartSettings.Description") ? PartSettings["ContentPartSettings.Description"] : null; }
}
}
}
}