blank item entry

2 posts, 0 answers
  1. Hetal
    Hetal avatar
    1 posts
    Member since:
    Jan 2016

    Posted 09 Feb Link to this post

    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
            });

  2. Marin
    Admin
    Marin avatar
    1043 posts

    Posted 11 Feb Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top