我创建了以下公共类colModelClass
,因此我可以为我的 colModel 字符串反序列化jqgrid
public class colModelClass
{
public string name { get; set; }
public string index { get; set; }
public string jsonmap { get; set; }
public bool editable { get; set; }
public bool sortable { get; set; }
public int width { get; set; }
public string align { get; set; }
public bool hidden { get; set; }
public string sorttype { get; set; }
public string formatter { get; set; }
public string formatoptions { get; set; }
}
问题是,formatoptions
不是字符串。它是一个json
具有无限数量的可能项目的对象。它不仅可以包含formatoptions
随附的每个标准项目,jqgrid
还可以包含自定义选项。
Type
我使用哪个formatoptions
将允许这样的对象:
{ "srcformat": "m/d/Y", "newformat": "m/d/Y" }
或这个
{ "decimalSeparator":".","thousandsSeparator":"," }
或任何其他数量的选项和组合(如果我添加其他选项,则不需要我更新我的课程)?
或者,我如何创建一个formatoptionsClass
可以接受任何字符串、bool、int 等的类,以便它可以动态构建该类?