I'm using full calendar with a asp.net MVC 5 application.
我正在使用带有asp.net MVC 5应用程序的完整日历。
When I click a on a empty space I get a modal view for creating a event. This works perfect.
当我点击空白区域时,我会得到一个用于创建事件的模态视图。这很完美。
When I click on a event I want to get the event data but also some other data then just the start date end date and description.
当我点击一个事件时,我想获取事件数据,还有一些其他数据,然后只是开始日期结束日期和描述。
I have the following:
我有以下内容:
eventRender: function (event, element) {
var id = event.id;
element.popover({
placement: 'top',
html: true,
content: '<button id="customers" class="btn btn-default" onclick="KlantenModal(' + id + ')">Klant overzicht</button>',
animation: true
});
}
The function that calls the modal.
调用模态的函数。
function KlantenModal(event) {
$('#klanten #eventId').val(event);
$('#klanten').modal('show');
}
and the bootstrap modal:
和bootstrap模式:
<div class="modal fade" id="klanten" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Klanten</h4>
</div>
<div class="modal-body">
/* here I want some Data eg. names of customers */
<input type="hidden" id="eventId" name="eventId" />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary"></button>
</div>
</div>
</div>
1 个解决方案
#1
0
If i understood you well the only thing you have to do is to add fields to the event like this:
如果我理解你,你唯一要做的就是为这个事件添加字段:
Somewhere in your code populate an array with diferent customers and add that array to the event properties
代码中的某处使用不同的客户填充数组,并将该数组添加到事件属性中
var customers = [];
customers.push("im customer x");
customers.push("im customer y");
...
events:[
{
'start': 2013-12-30,
'end': 2013-12-30,
'allDay': true,
'customers': customers
}
and when you click on the event and access the event fields you will get the customers field wich contains your customers for that day.
当您单击事件并访问事件字段时,您将获得包含当天客户的客户字段。
#1
0
If i understood you well the only thing you have to do is to add fields to the event like this:
如果我理解你,你唯一要做的就是为这个事件添加字段:
Somewhere in your code populate an array with diferent customers and add that array to the event properties
代码中的某处使用不同的客户填充数组,并将该数组添加到事件属性中
var customers = [];
customers.push("im customer x");
customers.push("im customer y");
...
events:[
{
'start': 2013-12-30,
'end': 2013-12-30,
'allDay': true,
'customers': customers
}
and when you click on the event and access the event fields you will get the customers field wich contains your customers for that day.
当您单击事件并访问事件字段时,您将获得包含当天客户的客户字段。