EasyUI Forum
April 28, 2024, 09:29:16 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: eDataGrid Time (DateTimeBox, TimeSpinner)  (Read 12951 times)
fornax
Newbie
*
Posts: 4


View Profile
« on: October 28, 2013, 05:13:43 PM »

Hello,

looks nice, works great and nearly get all Newby-Questions answered in the Forum. Thanks sworthy!

One thing I did not find (using EUI 1.3.4) and missing in eDataGrid is a (dropdown) Time-View: TimeSpinner or DateTimeBox.

Maybe I can stop searching if there is none of these available or solve it in any other way?

Thanks a lot!
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 28, 2013, 07:58:41 PM »

The 'timespinner' and 'datetimebox' editors should be extended before applying them.
Logged
fornax
Newbie
*
Posts: 4


View Profile
« Reply #2 on: October 29, 2013, 01:40:15 AM »

Thanks ... May you have an Example for these?
I am not really firm in extending editors  Shocked
Logged
finzaiko
Newbie
*
Posts: 44


View Profile
« Reply #3 on: July 19, 2014, 10:03:11 PM »

Yes, I try to extend edatagrid editor still not work even the last version :
Code:
$.extend($.fn.edatagrid.defaults.editors,
 { datetimebox: { init: function(container, options) { var input = $('<input type="text" class="easyui-datetimebox">').appendTo(container); return input; }, destroy: function(target) { $(target).remove(); }, getValue: function(target) { return $(target).val(); }, setValue: function(target, value) { $(target).val(value); }, resize: function(target, width) { $(target)._outerWidth(width); } }
--------
<th field="tanggal" width="150" editor="datetimebox">tanggal</th>
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: July 20, 2014, 05:34:34 PM »

Try this:
Code:
$.extend($.fn.datagrid.defaults.editors, {
  datetimebox:{
    init:function(container, options){
      var input = $('<input>').appendTo(container);
      input.datetimebox(options);
      return input;
    },
    destroy:function(target){
      $(target).datetimebox('destroy');
    },
    getValue:function(target){
      return $(target).datetimebox('getValue');
    },
    setValue:function(target,value){
      $(target).datetimebox('setValue',String(value));
    },
    resize:function(target,width){
      $(target).datetimebox('resize',width);
    }
  }
})
Logged
finzaiko
Newbie
*
Posts: 44


View Profile
« Reply #5 on: July 21, 2014, 02:32:42 AM »

Thanks stworthy, its work.
Logged
fornax
Newbie
*
Posts: 4


View Profile
« Reply #6 on: October 22, 2014, 08:02:23 PM »

Jepp! Thanks stworthy!

Finally everything works :-)
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!