【问题标题】:Jqgrid issue, the datetimepicker addon for Jquery doesn't workJqgrid 问题,Jquery 的 datetimepicker 插件不起作用
【发布时间】:2011-09-19 15:43:29
【问题描述】:

我正在尝试使用这个addon,这正是我所需要的,但不幸的是它不起作用,我已经被困了几天,我无法修复它,有人可以帮忙..?

这是插件时间选择器的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' });
                            }
                        }
                        }
                  ]

如果有任何帮助,我将不胜感激,在此先感谢。

问候

【问题讨论】:

  • 如果你能看到我正在使用 UI 日期选择器,它工作正常;)
  • 嗯...你能解释一下出了什么问题吗?另外,如果我们能看到网站或演示,或者至少有一些 html 代码和 js,那就太好了。
  • 问题是没有出现DateTimePicker控件,我的问题是如果我在函数(或函数调用)方面做得很好,我像datepicker一样实现了这个插件,我认为这会起作用,但没有。另一方面,因为我使用的控件 jqGrid 仅适用于从 JavaScript 代码进行调用,所以我无法提供与 HTML 相关的代码,并且我正在使用的 js 与可以从主页下载的相同。谢谢你的评论约瑟夫。问候

标签: jquery jquery-plugins jqgrid datetimepicker


【解决方案1】:
    $(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 }
     });

【讨论】:

  • 你应该添加一些关于如何解决问题的解释以及为什么!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-04-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多