【问题标题】:Why jqGrid can't convert serialized datetime json?为什么jqGrid不能转换序列化的日期时间json?
【发布时间】:2015-02-07 20:20:24
【问题描述】:

嗨, 在 jqGrid 上没有 datetime 的 Everythink 完美:S 如何解决这个转换问题?

【问题讨论】:

    标签: json jqgrid datetime-format jqgrid-asp.net


    【解决方案1】:

    你可以在你的 ColModel 中试试这个

    {name: 'colNmae', index: 'ColName', formatoptions: { srcformat: "ISO8601Long", newformat: "m/d/Y h:i A" }}
    

    或者这个

    {name: 'colNmae', index: 'ColName', sorttype: 'date', formatter: 'date', datefmt: 'd-M-Y'},
    

    【讨论】:

      【解决方案2】:

      您需要在 colModel 中将格式化程序设置为日期,jqGrid 将自动检测 Microsoft 日期格式。

      srcformat不需要设置,newformat可以设置。

      试试这个:

      colModel : [
      ...
      {name:'Mydate', ...formatter: 'date', formatoptions:{newformat 'm/d/Y'}, ...},
      ...
      ]
      

      【讨论】:

        【解决方案3】:

        这些列属性对我有用

        formatter: "date", formatoptions: { newformat: "ISO8601Long" }
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2012-05-30
          • 1970-01-01
          • 1970-01-01
          • 2019-07-23
          • 1970-01-01
          • 2013-09-20
          • 2023-01-19
          相关资源
          最近更新 更多