如何获取事件的id,fullcalender [英] How to get id of event, fullcalender
问题描述
我有一个弹出窗口,你可以添加一个事件,所以如果你点击一个事件你会看到事件的详细信息。我有一个删除按钮,就像这样
我有这个:
I have a popup where you can add an event, so if you click on a event you see the details of the event.And I have a delete button , like this
I have this:
eventClick: function (calEvent, jsEvent, view) {
alert(calEvent.id)
然后我可以看到id。但我也有删除功能,如下所示:
Then I can see the id. But I also have a delete function, like this:
$('#btnPopupDelete').click(function (e, calEvent) {
var id = calEvent.id;
alert(id);
DeleteEvent(id)
//$('#popupEventForm').hide();
});
但是id未定义。但这很有效:var id = 32
我这样解决了:
but then id is undefined. but this is working: var id = 32
I solved like this:
eventClick: function (calEvent, jsEvent, view) {
$('#btnPopupDelete').click(function () {
var id = calEvent.id;
alert(id);
DeleteEvent(id)
$('#popupEventForm').hide();
});
只有它必须刷新,否则删除后事件仍然停留,但f5和事件消失了
谢谢
only it has to be refreshed, otherwise after delete the event is still staying, but f5 and the event is gone
Thank you
推荐答案
(' #btnPopupDelete')。click(function(e, calEvent){
var id = calEvent.id;
alert(id);
DeleteEvent (id)
//
('#btnPopupDelete').click(function (e, calEvent) { var id = calEvent.id; alert(id); DeleteEvent(id) //
('#popupEventForm') .hide();
});
('#popupEventForm').hide(); });
但是id未定义。但这很有效:var id = 32
我这样解决了:
but then id is undefined. but this is working: var id = 32
I solved like this:
eventClick: function (calEvent, jsEvent, view) {
(' #btnPopupDelete')。click(function(){
var id = calEvent.id;
alert(id) ;
DeleteEvent(id)
('#btnPopupDelete').click(function () { var id = calEvent.id; alert(id); DeleteEvent(id)
这篇关于如何获取事件的id,fullcalender的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!