2011-09-19 99 views
1

我试图用这个addon这正是我需要的,但不幸的是没有工作,我一直坚持这几天,我不能修复它,有人可以帮助..?Jqgrid的问题,jQuery的datetimepicker插件不起作用

这里是插件timepicker

home page ...这是我的javascript代码...

colModel: [ 
      { name: 'Id', index: 'Id', width: 50 }, 
      { name: 'Entrada', index: 'Enlaces', width: 80, sortable: true, editable: true, edittype: "select", editoptions: { dataUrl: '/Entrada/Listado/'} }, 
      { name: 'FechaInicio', index: 'FechaInicio', width: 90, editable: true, edittype: "text", editoptions: { 
          dataInit: function (el) { 
           $(el).datepicker({ dateFormat: 'yy-mm-dd', 
            onSelect: function (dateText, inst) { 
             var $input = inst.input; 
             var $row = $input.parents("tr"); 
             $("#list").jqGrid('saveRow', $row.attr("id"), false); 
            } 
           }); 
          } 
         } 
         }, 
      { name: 'HoraInicio', index: 'HoraInicio', width: 80, sortable: true, editable: true, edittype: "text", editoptions: { 
          dataInit: function (tm) { 
           $(tm).datetimepicker({ dateFormat: 'yy-mm-dd' }); 
          } 
         } 
         } 
        ] 

我希望得到任何帮助,在此先感谢。

问候

+0

如果你能看到我使用的UI日期选择器,它的做工精细;) – verofairy

+0

唔...你能不能解释一下什么错误?此外,如果我们可以看到该网站或演示,或者至少有一些html代码以及js,那就太棒了。 –

+0

问题是没有出现DateTimePicker控件,我的问题是如果我做的很好的函数(或函数调用),我实现了这个插件像datepicker,我认为这会工作,但没有。另一方面,因为我只使用JavaScript代码调用的控件jqGrid,所以我没有提供与HTML相关的代码,而我使用的js可以从主页下载。感谢你的commet约瑟夫。问候 – verofairy

回答

0
$(el).datetimepicker({ 
          changeMonth: true, 
          changeYear: true, 
          showSecond:true, 
          dateFormat:'yy-mm-dd', 
          timeFormat:'hh:mm:ss', 
          hourGrid: 4, 
          minuteGrid: 10, 
          secondGrid: 10, 
          addSliderAccess: true, 
          sliderAccessArgs: { touchonly: false } 
    }); 
+0

你应该添加一些关于如何解决这个问题的解释,为什么! –