0
嗨,這裏我想從div中刪除數據並重新綁定到該div的新數據。 我怎樣才能在div標籤中實現這個one.here在透明充滿日曆與一些事件。 在這裏,我想刪除該分區的數據,並重新綁定新的事件,以相同的div標籤刪除以前的數據在div標記和綁定新的數據到相同的div標記
$.ajax({
type: "POST",
contentType: "application/json",
data: dataString,
url: "ViewEvents.aspx/GetState",
dataType: "json",
success: function (data) {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
//select: selectDate,
eventClick: updateEvent,
droppable: false,
draggable: false,
disableDragging: true,
timeFormat: 'H:mm',
selectable: true,
selectHelper: true,
eventTextColor: 'Yellow',
eventBackgroundColor: 'purple',
events:
$.map(data.d, function (item, i) {
// $('#calendar').fullCalendar('addEventSource', item);
var sdate = item.StartDate
var sdatesplit = sdate.split("/");
var sm = sdatesplit[0];
var sm = sm - 1;
var sd = sdatesplit[1];
var sy = sdatesplit[2];
var syearsplit = sy.split(" ");
var edate = item.EndDate;
var edatesplit = edate.split("/");
var em = edatesplit[0];
var em = em - 1;
var ed = edatesplit[1];
var ey = edatesplit[2];
var eyearsplit = ey.split(" ");
var stime = item.EventStarttime;
var stimesplit = stime.split(":");
var etime = item.EventEndtime;
var etimesplit = etime.split(":");
var event = new Object();
event.id = item.EventID;
event.start = new Date(syearsplit[0], sm, sd, stimesplit[0], stimesplit[1]);
event.end = new Date(eyearsplit[0], em, ed, etimesplit[0], etimesplit[1]);
event.title = item.EventName;
event.allDay = false;
return event;
})
});
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
debugger;
}
});
'$( '#壓延機')HTML( '');'應該清除它。 – DevZer0