-->

How to extend scheduler agenda view to include add

2019-04-09 20:26发布

问题:

I am using Kendo Scheduler control. By default it is showing "Date","Time" and "Event" in the "Agenda" view. How to extend scheduler agenda view to include additional column as shown in attached image?

I tried templates as shown below.

     <script id="event-template" type="text/x-kendo-template">
     <button class="edit-event" data-uid="#=uid#">Custom Column</button>
     <div>Notes: #: notes#</div>

     </div>
     </script>

and in Kendo initialization,i added below code

      views: [
      {
        type: "agenda",
        eventTemplate: $("#event-template").html()
      },
     ],

But it did not render as expected :(

I tried below url Kendo Forum link but it's not redirected me to any solution.

回答1:

To add a custom view which current existing are day, week, month, agenda & timeline, you have to make an extended class which extend from kendo.ui class as Kendo UI code library example gave to us.

I encourage you to follow that example so it will work properly for edit, remove and recurrence events. Therefore you should look into it, yet if you have scheduler that only display events with simplicity just want to add custom column inside existing view, you can see my example here.

I exploit scheduler data bound events and write necessary DOM to header and body of scheduler, so it will reflect just like what you had describe above.

Scheduler Custom View Code Library - recommended solution

Scheduler Custom Column Alternative

Hope this help..



回答2:

Apparently it does not supported by kendo, kendo team says :

Adding more columns to the "Agenda" view is not supported out of the box and it will require custom solution which is out of scope of our support service

But you can extend the scheduler widget like mentioned on the forum post, there also 2 sample of way extending the widget



回答3:

      schedulerHeader.append("<th>Rating</th>"); 
      schedulerHeader.append("<th>Time</th>"); 

Hmm, the comment above didn't have formatting so I'll post the above again. This helps, but I think I need to rewrite the whole template.

The example telerik keeps giving for a custom view is ok but very basic. It only does the DataHeaderTemplate and event template, it doesn't add columns.

I'm looking for a column after every day, so I can put extra visual lines to show the status. Sounds like I need to rewrite the column and header templates. I don't see any good examples of that