在完整日历中添加资源视图 [英] add resource view in full calender

查看:69
本文介绍了在完整日历中添加资源视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,



我使用完整的日历API来查看项目中的事件。现在项目需求发生变化,需要添加名为resource的新视图。我试过谷歌,但没有得到成功的结果。



你有任何一个想法。



提前谢谢。

Hello frnds,

I am using full calendar API for viewing the events in my project. now project requirement change and need to add new view named resource. I tried with google but not get success result for this.

have you any one idea about this.

Thanks in advance.

推荐答案

首先,我想建议你用户手册 [ ^ ]。

现在

资源::向日历介绍可用资源。资源ID链接到Event对象资源属性。事件对象资源也可以是一个数组!这是一个基本的JSON数组,包括资源名称和ID。它还可以包含readonly boolean,它只设置资源。



例如:

First of all i would like to suggest you the User Manual[^] for Resource-Calender.
Now
Resources :: Introduces available resources to calendar. Resource id links to Event objects resource property. Event objects resource can be also an array! This is a basic JSON-array which includes resource name and id. It can also include readonly boolean which sets resource readonly.

For example:
resources: [
    {
    	name: 'Resource 2',
    	id: 'resource2'
    },
    {
    	name: 'Resource 1',
    	id: 'resource1',
    	readonly: true 
    }
    ],
    events: [	
    {
    	title: 'Long Event',
    	start: new Date(y, m, d-5),
    	end: new Date(y, m, d-2),
    	resource: 'resource1'
    },
    {
    	title: 'Meeting',
    	start: new Date(y, m, d, 10, 30),
    	allDay: false,
    	resource: ['resource4','resource2']
    }	
    ],



您还可以在资源选项中插入一个URL(如在事件中):

资源:'http://hostname/jsonresources.php'



不同颜色的周末标题? ::你可以使用类fc-weekend来影响周末标题和fc-weekend-column周末列,例如背景颜色。



一个非常简单的方法使用PHP的FullCalendar的多个资源




You can also insert a URL in the resources option (like in events):
resources: 'http://hostname/jsonresources.php'

Weekend headers in different color? :: You can use class fc-weekend to affect to weekend headers and fc-weekend-column for weekend columns for example background color.

A VERY simple way to pass multiple resources to FullCalendar with PHP

// This is a sample array


resources = array(
数组( name => 资源1,id => resource1),
数组( name => 资源2,id => resource2
);

// json_encode编码数组
resources = array( array("name" => "Resource 1", id => "resource1"), array("name" => "Resource 2", id => "resource2") ); // json_encode encodes array


resources_JSON_array = json_encode(
resources_JSON_array = json_encode(


这篇关于在完整日历中添加资源视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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