This is a migrated thread and some comments may be shown as answers.

blank item entry

1 Answer 59 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Hetal
Top achievements
Rank 1
Hetal asked on 09 Feb 2016, 11:39 PM

how can I add a blank item at the top of TimePicker list?

 

My code looks like this,

 

function timeEditor(container, options) {
            $('<input data-text-field="' + options.field + '" data-value-field="' + options.field + '" data-bind="value:' + options.field + '" data-format="' + options.format + '"/>')
                    .appendTo(container)
                    .kendoTimePicker({
                        //interval: 15
                        //max: new Date(2000, 0, 1, 22, 0, 0) //date part is ignored
                        //min: new Date(2000, 0, 1, 8, 0, 0) //date part is ignored
                    });
        }

        $("#HoursGrid").kendoGrid({
            dataSource: {
                data: @Html.Raw(Json.Encode(Model.HoursList)),
                schema: {
                    model: {
                        fields: {
                            DealerID: {type: "int", editable: false},
                            dayNo: {type: "int", editable: false},
                            dayName: { type: "string", editable: false },
                            OpenTime: { type: "date", editable: true },
                            CloseTime: { type: "date", editable: true }
                        }
                    }
                }
            },
            //toolbar: ["save"],
            columns:[
                {   field: "dayName",          title: "Day of Week"   },
                {   field: "OpenTime",    title: "Sales Hours - Open From",  type: "date", format: "{0:hh:mm tt}", editor: timeEditor  },
                {   field: "CloseTime",   title: "Close At",                 type: "date", format: "{0:hh:mm tt}", editor: timeEditor  }
            ],
            editable: true,
            scrollable: false,
            save: function(e){
            },
            databound: DD.Kendo.AddExtraStyleToGrid // this is where the hover effect function is bound to grid
        });

1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 11 Feb 2016, 09:34 AM
Hello,

You can add a new item to the grid by calling the add method of the its dataSource. Additional information can be found here:
http://www.telerik.com/forums/add-row-in-kendo-grid

Regards,
Marin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Date/Time Pickers
Asked by
Hetal
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or