フル カレンダーを使用していますが、翌月/年をクリックすると、すべてのテーブルの td フィールドが更新されます。
すべてのデータが更新されonClick
たら、新しいデータも取得する必要があります。
リフレッシュするためのコードは以下のとおりです
function updateCells(firstTime) {
//alert('called');
var startYear = t.start.getFullYear();
var today = clearTime(new Date());
var cell;
var date;
var row;
subTables.each(function(i, _sub){
var d = cloneDate(t.start);
d.setFullYear(d.getFullYear(),i,1);
d.setFullYear(d.getFullYear(),i,1-d.getDay());
$(_sub).find('td').each(function(ii, _cell) {
cell = $(_cell);
if (d.getMonth() == i) {
cell.removeClass('fc-other-month');
}else{
cell.addClass('fc-other-month');
}
if (+d == +today && d.getMonth() == i) {
cell.addClass(tm + '-state-highlight fc-today');
}else{
cell.removeClass(tm + '-state-highlight fc-today');
}
cell.find('div.fc-day-number').text(d.getDate());
cell.find('div.fc-day-number').setAttribute('onClick','clicked("' + d.getDate() + '"');
//document.getElementsByTagName('div.fc-day-number').setAttribute('onClick','clicked("' + d.getDate() + '"');
addDays(d, 1);
});
});
bodyRows.filter('.fc-year-have-event').removeClass('fc-year-have-event');
}
エラーは
TypeError: document.getElementsByTagName(...).setAttribute is not a function
onClick イベントで新しいデータを設定する方法を知っている人はいますか。