在事件的第一行添加图标(fullCalendar) [英] Add Icon(s) in first line of an event (fullCalendar)

查看:853
本文介绍了在事件的第一行添加图标(fullCalendar)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于要在'fullCalendar'矩阵中显示的事件的特定属性,我想添加图标以显示它们,'已完成'(i)按钮或URL符号以防事件包含URL链接。



我不想将任何html字符串写入< a>中的其中一个元素(fc-event-time / -title)元素,但定义一个像这样的附加元素:

 < a> 
< span class =fc-event-time> 15:15 - 16:15< br>< / span>
**< span class =fc-event-icons> < / span> **
< span class =fc-event-title> Fri Dille< / span>
< / a>

这里有什么帮助吗?
Günter

解决方案

嗯,这个话题已经很久了,但我在这里找不到如何用< img> 标记,所以我在这里以另一种方式将图像置于fullcalendar事件中:

添加 eventObject 图像的路径。如果您使用JavaScript,它会是这样的:

  events:[
{
title:'event1 ',
start:'2010-01-01',
imageurl:'img / edit.png'
},
{
title:'event1',
start:'2010-01-01'
}]

然后 eventRender 只需放置图像:

  eventRender:function(event,eventElement ){
if(event.imageurl){
eventElement.find(div.fc-content)。prepend(< img src ='+ event.imageurl +''width =' 12'height ='12'>);




$ b $ p $如果你想在所有图片上使用相同的图片项目,你只需要把它放在你的 eventRender 中:

  eventElement .find(div.fc-content)。prepend(< img src ='pathtoimage.png'width = '12'height ='12'>); 


For specific attributes of an event to be displayed in the 'fullCalendar' matrix I would like to add icons to show them, for 'completed' an (i) button, or an URL symbol in case the event contains an URL link.

I don't want to write any html string to one of the elements (fc-event-time/-title) in the <a> element, but define an additional element like this:

<a>
  <span class="fc-event-time">15:15  - 16:15<br></span>
  **<span class="fc-event-icons"> ..some definitions for icons here ..</span>**
  <span class="fc-event-title">Fri Dille</span>
</a>

Any help here? Günter

解决方案

Well this topic is old, but I couldn't find here how to do it with <img> tags so I leave here another way to put images in fullcalendar events:

Add in your eventObject a path to the image. If you use javascript it would be something like:

events: [
    {
        title  : 'event1',
        start  : '2010-01-01',
        imageurl:'img/edit.png'
    },
    {
        title  : 'event1',
        start  : '2010-01-01'
    }]

Then on eventRender just put the image:

eventRender: function(event, eventElement) {
    if (event.imageurl) {
        eventElement.find("div.fc-content").prepend("<img src='" + event.imageurl +"' width='12' height='12'>");
    }
},

If you want to use the same image on all items, you just need to put this in your eventRender:

eventElement.find("div.fc-content").prepend("<img src='pathtoimage.png' width='12' height='12'>");

这篇关于在事件的第一行添加图标(fullCalendar)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆