This is a migrated thread and some comments may be shown as answers.
TimePicker doesn't work at all
3 Answers 10 Views
This is a migrated thread and some comments may be shown as answers.
Adrian
Top achievements
Rank 1
Adrian asked on 07 Sep 2018, 06:38 AM

Hello.

I want to create grid where in some of the columns would be a datepicker just to select the time.

 

Here is a data which I recive (1 record sample) : {shopID: 16, scheduleDay: "2000-01-01T00:00:00", shopWorkingHourID: 1,…}

 

Here is my model schema :

                schema: {
                    model: {
                        fields: {
                            shopID: "shopID",
                            scheduleDay: "scheduleDay",
                            workStartHour: "workStartHour",
                            workEndHour: "workEndHour",
                        }
                    }
                }

 

Here is my column configuration :

                columns: [
                    {
                        field: "shopID"
                    },
                    {
                        field: "scheduleDay",
                        format: "{0:yyyy/MM/dd}"
                    },
                    {
                        
                        field: "workStartHour",
                        editor: function (container, options) {

                           console.log('here');
                            var input = $("<input/>");
                            input.attr("workStartHour", options.model.workStartHour);

                            input.appendTo(container);

                            input.kendoTimePicker({});
                        },
                        format:"{0:HH:mm}",
                    }]

Time is displayed correctly but I cannot pick the time, even picker isn't shown.

 

Some crucial information

* I've tried convert data I receive to new Date

* I've included scripts corectly

* I don't get any errors

 

I'll take any advice how to make this work.

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 10 Sep 2018, 12:16 PM
Hi Adrian,

When creating a custom editor it is necessary to set the name attribute for it to the relevant field. This way the value will be bound to the underlying editor correctly. Please modify the editor function like in the following snippet and let me know how the behavior changes:

editor: function(container, options) {
  var input = $("<input/>");
  input.attr("name", options.field);
  input.appendTo(container);
 
  input.kendoTimePicker();
}

In case the behavior persists please send us a dojo sample where the issue is replicated so we can examine it locally. 


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Adrian
Top achievements
Rank 1
answered on 10 Sep 2018, 12:39 PM
I gave up on this, but It start working when I created editinline mode.
0
Viktor Tachev
Telerik team
answered on 12 Sep 2018, 09:57 AM
Hello Adrian,

Thank you for the follow-up.

In case you decide to get back to this at some point please send us a sample we can look at. This will enable us it to debug the code and look for what is causing the unexpected behavior. 


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Adrian
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Adrian
Top achievements
Rank 1
Share this question
or