TimePicker doesn't work at all

4 posts, 0 answers
  1. Adrian
    Adrian avatar
    13 posts
    Member since:
    Aug 2018

    Posted 07 Sep 2018 Link to this post

    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.

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2497 posts

    Posted 10 Sep 2018 Link to this post

    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.
  3. Adrian
    Adrian avatar
    13 posts
    Member since:
    Aug 2018

    Posted 10 Sep 2018 Link to this post

    I gave up on this, but It start working when I created editinline mode.
  4. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2497 posts

    Posted 12 Sep 2018 Link to this post

    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.
Back to Top