If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#51886 by Jaymer
Fri Oct 18, 2019 3:51 am
I have an app that used to use 2 fields, Hours & Mins to indicate time on a job.
1 good thing about that approach was Mins was a Choices field with 0, 15, 30, 45 as the only 4 choices.
But because of entry inline in a Grid, I'd rather have a single Time field, but I want to round all time into 15 minute chunks.

I was thinking a JS function might be the easiest - no traffic back & forth to the server, let this happen in the browser Local on the user's machine.
(there's lots of this going on, so I don't want to add traffic & server processing)

Forum threads indicate I can trap when a field loses focus. And I can setValue back into the Kendo field.
All time needs to round up to next .25 increment.
Multiply time x 4, then round up, then div by 4.

Code: Select allvar f = parser.getField("Day1");
$("#" + f.getId ()).focusout (function () {
   var Value1 = parser.getField("Day1").getValue ();
   f.setValue ( Math.ceil( Value1 * 4)/4 );
});


Works perfectly in a form, but
How do I get this to work in a Grid?
I'll have 7 fields (each day of week) and I know I'll need this 7 times (Day1 thru Day7).

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests