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 all
var f = parser.getField("Day1");
$("#" + f.getId ()).focusout (function () {
var Value1 = parser.getField("Day1").getValue ();
f.setValue ( Math.ceil( Value1 * 4)/4 );
});
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).