How can add new field to an event with dhtmlx scheduler?

和自甴很熟 提交于 2019-12-08 04:39:05

问题


I want to add new fields or propierties to an calendar event. How can I do it?

Thanks!


回答1:


You need to

  • add new section to lightbox form http://docs.dhtmlx.com/doku.php?id=dhtmlxscheduler:details_form
  • for new section of lightbox, set map_to value as name of new field
  • on server side add extra field to the list of fields in render command



回答2:


This is how you would create a simple href link inside an event:

1) Go to the Event Configuration Console and create a custom field, under the section that says 'CUSTOM FIELD'. Give the field a name. In this example, call it 'url'. Select its type as 'TextArea'.

2) Create another custom field, call it 'link_title'.Also a 'TextArea'. Description is optional.

SAVE

3) Go to the 'Templates' section of the event console. Under the first section (... scheduler.templates.event_text=function(start,end,event){... ) where you can input text, put ->

return "<b> "+event.text+"</b><br><br><a href=\"http://" + event.url + "\">" + event.link_title + "</a>";

SAVE

When you go to create your event from the main calendar, you will see extra fields. Type in them, save your event, and voila. Toot Sweet.




回答3:


What do you mean by calendar event?

Is it adding a new event?, then it must be done using lightbox(built-in option)

 scheduler.config.lightbox.sections=[
            { name:"description", height:50, map_to:"text", type:"textarea", focus:true },
            { name:"location", height:43, map_to:"event_location", type:"textarea",
                default_value:"Blackheath Avenue London,Greenwich,Greater London SE10 8XJ,UK"},
            {name:"recurring", height:115, type:"recurring", map_to:"rec_type",
                button:"recurring"},
            { name:"time", height:72, type:"time", map_to:"auto"}
        ];

each tag used in here is suppoted by the plugin,,,,in you want to have a seperate customize lightbox go to

http://docs.dhtmlx.com/scheduler/custom_details_form.html

This is the preview



来源:https://stackoverflow.com/questions/10613960/how-can-add-new-field-to-an-event-with-dhtmlx-scheduler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!