This commit is contained in:
2020-03-29 00:47:19 +00:00
parent becdba1e97
commit 63ba7099ce
10 changed files with 124 additions and 125 deletions

View File

@@ -74,19 +74,19 @@ namespace AyaNova.DataList
sb.Append("{");
//Build required part of column definition
if (!o.IsCustomField)
sb.Append($"\"cm\":\"{o.LtKey}\",\"dt\":{(int)o.UiFieldDataType}");
sb.Append($"\"cm\":\"{o.TKey}\",\"dt\":{(int)o.UiFieldDataType}");
else
{
//insert specific type for this custom field
if (CustomFieldDefinitions.ContainsKey(o.LtKey))
if (CustomFieldDefinitions.ContainsKey(o.TKey))
{
var customFieldType = CustomFieldDefinitions[o.LtKey];
sb.Append($"\"cm\":\"{o.LtKey}\",\"dt\":{customFieldType}");
var customFieldType = CustomFieldDefinitions[o.TKey];
sb.Append($"\"cm\":\"{o.TKey}\",\"dt\":{customFieldType}");
}
else
{
//this is normal as there may not be a definition for a Custom field but it's been requested so just treat it like text
sb.Append($"\"cm\":\"{o.LtKey}\",\"dt\":{(int)UiFieldDataType.Text}");
sb.Append($"\"cm\":\"{o.TKey}\",\"dt\":{(int)UiFieldDataType.Text}");
}
}
@@ -131,7 +131,7 @@ namespace AyaNova.DataList
{
//this relies on the convention I'm using of AyaType name as the first part of all custom fields lT keys, e.g.
//WidgetCustom1 -> Widget
var ayatypename = d.LtKey.Split("Custom")[0];
var ayatypename = d.TKey.Split("Custom")[0];
if (!typesProcessed.Contains(ayatypename))
{
//make sure we do each type only once