Set time new record added in datatable

Hi,

  1. Is it possible to set the current system time (8:00 AM) when a new datatable record is created?
  2. Per attached image, is it possible to tab through all columns? Currently if i hit tab it will go directly to the trash can, skipping all columns.

Thanks!

Hello @ParAvion,

  1. What do you mean under the current system time?
  2. Currently, this is not possible. But we will think of implementing this in the future.

Hi @mnikitina,

I just meant the current Windows / PC time. So if i'm adding a new record, the current local time is displayed (10:00 AM). A time stamp basically.

Thanks.

Hello @ParAvion,

You can set the value of the column in "Data Table" control with the current time using the following code.

Please replace 'DataTable0' with the internal name of the control. Column0 - is the column InternalName.

  1. New Lines are added to the Top .
    image
fd.spRendered(function() {
	fd.control('DataTable0').$on('change',
    function(e) {
        var date = new Date();
        var time = date.toLocaleTimeString(navigator.language, {hour: '2-digit', minute:'2-digit'});
        fd.control('DataTable0').value[0].Column0 = time;
    });
}); 
  1. New Lines are added to the Bottom
    image
fd.spRendered(function() {
	fd.control('DataTable1').$on('change',
    function(e) {
        var date = new Date();
        var time = date.toLocaleTimeString(navigator.language, {hour: '2-digit', minute:'2-digit'});
    	var rec = parseInt(fd.control('DataTable0').value.length) - 1;
        fd.control('DataTable0').value[rec].Column0 = time;
    });
});