This commit is contained in:
@@ -149,17 +149,27 @@ namespace AyaNova.Biz
|
|||||||
// StringWriter sw = new StringWriter();
|
// StringWriter sw = new StringWriter();
|
||||||
// JsonTextWriter writer = new JsonTextWriter(sw);
|
// JsonTextWriter writer = new JsonTextWriter(sw);
|
||||||
// writer.WriteStartObject();//{
|
// writer.WriteStartObject();//{
|
||||||
// ColumnsJSON=@"""columns"":[ {""cm"":""Widget"",""dt"":""text"",""ay"":"+ AyaType.Widget.ToString()+ "}]";
|
// ColumnsJSON=@"""columns"":[ {""cm"":""Widget"",""dt"":""text"",""ay"":"+ AyaType.Widget.ToString()+ "},{..etc..}]";
|
||||||
|
sb.Append("\"columns\":[");
|
||||||
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
|
||||||
|
sb.Append("{");
|
||||||
|
//Build required part of column definition
|
||||||
|
sb.Append($"\"cm\":\"{o.Key}\",\"dt\":\"{o.DataType}\"");
|
||||||
|
|
||||||
|
//Has a AyObjectType (linkable / openable?)
|
||||||
|
if(o.AyObjectType!=0)
|
||||||
|
sb.Append($",\"ay\":{o.AyObjectType}");
|
||||||
|
|
||||||
|
sb.Append("}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sb.Append("]");
|
||||||
// writer.WriteEndObject();//}
|
// writer.WriteEndObject();//}
|
||||||
return sw.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user