2013-08-27 34 views
0

我正在使用jqGrid 4.5.1。當我使用datepicker控件時,colmodel中指定的格式僅適用於編輯。jqgrid與日期選擇器控件的錯誤

當我選擇一個日期並添加一行時,它會在網格中顯示一個隨機數作爲日期(例如,如果我從datepicker選擇2013-08-28則顯示2194-09-08)。

注意編輯工作,但只添加新行有這個問題。

當我們使用舊版本的jqGrid(3.8.2)時,也不會發生這種情況。我沒有嘗試,但我引用舊的jqGrid庫從本網站 http://www.ok-soft-gmbh.com/jqGrid/LocalFormEditing.htm

我認爲這是在最新版中的錯誤。那我包括的文件有:

jquery 1.9.1 
jqueryUI 1.10.3 
grid.locale-en.js 
jquery.jqgrid.js 

我認爲這是jqGrid的不使用jQuery的最新版本正常工作的錯誤。

有沒有人試過jqGrid與datepicker與最新的jQuery,jqGrid和jQuery UI庫?

感謝。

回答

0

我有一個模板:

var colDateTemplate = { 
editable: true, 
width: 200, 
align: "center", 
sortable: true, 
sorttype: "date", 
editrules: { date: true }, 
editoptions: {   
    size: 20, 
    maxlengh: 10, 
    dataInit: function(element) { 
     $(element).datepicker({ 
      showOn: 'both', 
      dateFormat: 'dd/mm/yy', 
      buttonImage: '/images/calendar-icon.png', 
      buttonImageOnly: true 
     }); 
    } 
}, 
searchoptions: { 
    sopt: ['eq', 'ne', 'lt', 'le', 'gt', 'ge', 'nu', 'nn'], 
    dataInit: function(element) { 
     $(element).datepicker({ 
      showOn: 'both', 
      dateFormat: 'dd/mm/yy', 
      buttonImage: '/images/calendar-icon.png', 
      buttonImageOnly: true 
     }); 
    } 
} 

}

,當我搜索,並用日期選擇字段,運營商「爲空」和「不爲空」丟失。 我使用jqGrid 4.5.2,jQuery UI Timepicker 0.3.1,jQuery UI - v1.8.20