EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Tomas on May 19, 2020, 12:44:58 PM



Title: timepicker not working in datagrid
Post by: Tomas on May 19, 2020, 12:44:58 PM
Hi,

  Is there a trick to get the timepicker to work in a datagrid?

Thanks,
Tomas


Title: Re: timepicker not working in datagrid
Post by: jarry on May 20, 2020, 06:48:28 PM
Please entend this editor before using it.
Code:
$.extend($.fn.datagrid.defaults.editors, {
  timepicker: {
    init: function(container, options){
        var input = $('<input type="text" class="datagrid-editable-input">').appendTo(container);
        input.timepicker(options);
        return input;
    },
    destroy: function(target){
        $(target).timepicker('destroy');
    },
    getValue: function(target){
        return $(target).timepicker('getValue');
    },
    setValue: function(target, value){
        $(target).timepicker('setValue',value);
    },
    resize: function(target, width){
        $(target).timepicker('resize',width);
    }
  }
})


Title: Re: timepicker not working in datagrid
Post by: Tomas on May 21, 2020, 07:53:07 AM
Awesome! Thanks.