This commit is contained in:
2020-01-15 18:58:56 +00:00
parent de08030b37
commit 05e07c5ac1

View File

@@ -149,11 +149,16 @@ namespace AyaNova.Biz
// ColumnsJSON=@"""columns"":[ {""cm"":""Widget"",""dt"":""text"",""ay"":"+ AyaType.Widget.ToString()+ "},{..etc..}]"; // ColumnsJSON=@"""columns"":[ {""cm"":""Widget"",""dt"":""text"",""ay"":"+ AyaType.Widget.ToString()+ "},{..etc..}]";
sb.Append("\"columns\":["); sb.Append("\"columns\":[");
var isFirstColumn = true;
foreach (string s in fullFields) foreach (string s in fullFields)
{ {
ObjectField o = fields.FirstOrDefault(x => x.Key == s); ObjectField o = fields.FirstOrDefault(x => x.Key == s);
if (o != null) if (o != null)
{//Here is where we can vet the field name, if it doesn't exist though, for now we'll just ignore it {//Here is where we can vet the field name, if it doesn't exist though, for now we'll just ignore it
if (!isFirstColumn)
{
sb.Append(",");
}
sb.Append("{"); sb.Append("{");
//Build required part of column definition //Build required part of column definition
sb.Append($"\"cm\":\"{o.Key}\",\"dt\":\"{o.DataType}\""); sb.Append($"\"cm\":\"{o.Key}\",\"dt\":\"{o.DataType}\"");
@@ -163,6 +168,7 @@ namespace AyaNova.Biz
sb.Append($",\"ay\":{o.AyObjectType}"); sb.Append($",\"ay\":{o.AyObjectType}");
sb.Append("}"); sb.Append("}");
isFirstColumn = false;
} }
} }
sb.Append("]"); sb.Append("]");