3 Answers, 1 is accepted
0
Hello Jan Kaare,
There is no such time type for the model. The supported ones are :
like noted in the documentation for the schema:
http://docs.kendoui.com/api/framework/datasource#configuration-schema.model
If you want to create custom editor template you should specify it like this:
Kind regards,
Petur Subev
the Telerik team
There is no such time type for the model. The supported ones are :
{Number|String|Boolean|Date} default is String
like noted in the documentation for the schema:
http://docs.kendoui.com/api/framework/datasource#configuration-schema.model
If you want to create custom editor template you should specify it like this:
$productName = new \Kendo\UI\GridColumn();
$productName->field('TheFieldName')
->editor('foo')
->title('Product Name');
<!-- where foo is the name of the JavaScript function which will initialize your widget such as TimePicker -->
<
script
>
function foo(container, options) {
$('<
input
data-bind
=
"value:' + options.field + '"
/>')
.appendTo(container)
.kendoTimePicker();
}
</
script
>
Kind regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jan Kaare
Top achievements
Rank 2
answered on 17 Apr 2013, 10:52 PM
Thanks for this clarification on how to implement a grid cell timepicker.
The timepicker is now implemented.
However, I experience problems with the timepicker usage.
Within mySQL database the field is set to type time.
Within the grid, the DataSourceSchemaModel field type is set to date.
For the culture nb-NO utilization, for which the javascript sets .kendoTimePicker({ culture: "nb-NO" }) and the PHP wrapper sets $GridColumn->format("{0:HH:mm}");, when time 14:00 as an example is selected, in the grid cell it first looks ok as the field displays this time being set. The resulting time value in database however ends up as 00:20:13, and when the page and grid are then reloaded, the time field value is gone and comes up blank (no value). I guess this resulting database value 00:20:13 represents the year 2013?
When mySQL database field is set to type datetime instead, the resulting time part in database ends up as GMT corrected that means 2 hrs correction for the Norwegian summer time. I would believe that when 14:00 is selected in timepicker, it would end up as 14:00 in database and not as 12:00. For this case also, when the page and grid are then reloaded, the time field value is gone and comes up blank (no value).
Do you have any experience with similar strange date related things like these?
The timepicker is now implemented.
However, I experience problems with the timepicker usage.
Within mySQL database the field is set to type time.
Within the grid, the DataSourceSchemaModel field type is set to date.
For the culture nb-NO utilization, for which the javascript sets .kendoTimePicker({ culture: "nb-NO" }) and the PHP wrapper sets $GridColumn->format("{0:HH:mm}");, when time 14:00 as an example is selected, in the grid cell it first looks ok as the field displays this time being set. The resulting time value in database however ends up as 00:20:13, and when the page and grid are then reloaded, the time field value is gone and comes up blank (no value). I guess this resulting database value 00:20:13 represents the year 2013?
When mySQL database field is set to type datetime instead, the resulting time part in database ends up as GMT corrected that means 2 hrs correction for the Norwegian summer time. I would believe that when 14:00 is selected in timepicker, it would end up as 14:00 in database and not as 12:00. For this case also, when the page and grid are then reloaded, the time field value is gone and comes up blank (no value).
Do you have any experience with similar strange date related things like these?
0
Hello Jan,
Not exactly sure what is the case with the PHP wrappers - I assume the problem is because the datetime JavaScript objects are always created with the offset of the browser. Similar question is covered here, it might point you in the right direction.
http://stackoverflow.com/questions/948532/how-do-you-convert-a-javascript-date-to-utc
Kind Regards,
Petur Subev
the Telerik team
Not exactly sure what is the case with the PHP wrappers - I assume the problem is because the datetime JavaScript objects are always created with the offset of the browser. Similar question is covered here, it might point you in the right direction.
http://stackoverflow.com/questions/948532/how-do-you-convert-a-javascript-date-to-utc
Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!