用的是Ext.grid.GridPanel+RowEditor插件,数据是从后台返回json,而json中日期类型如:\/Date(1213718400000+0800)\/。在显示的时候给个renderer方法它
renderer: function(value) { return eval("new " + value.substr(1, value.length - 2)).toLocaleString(); } 
现在可以在单元格中显示如2010年X月X日 0:00:00。但是当激活了编辑模式后(RowEditor插件)获出来的单元格内容一样是原始的/Date(1272643200000+0800)/,同时弹出Object doesn't support this action的js错误。请问如何解决才能在编辑状态中正确返回正常的日期?(编辑状态这个单元格应该是要用一个EXT的日期控件的)

解决方案 »

  1.   

    grid+可编辑插件的演示在下面,但是他这里是直接在JS中生成的json数组并不是json数组,所以他的日期格式没问题。
    http://dev.sencha.com/deploy/dev/examples/grid/row-editor.html
      

  2.   

    before you start to edit ,you can do something to prohibit this .
      

  3.   


    EXT的日期控件的写上format("Y-m-d")
    不过ext日期控件没有时间。可以找一个扩展的