Reputation: 54103
I have the following JS function:
function addTopLinks() {
$('#calendar .fc-view-resourceNextWeeks thead th .fc-resourceName')
.addClass('top-cell');
};
It is not adding the class.
I have another:
function addDayClass() {
$('#calendar .fc-view-resourceNextWeeks thead th')
.filter(function () {
if ($(this).text().indexOf('Mon ') == 0) return true;
return false;
})
.addClass('monday');
};
That one works just fine.
This is the hierarchy:
I am really not sure why the first one is working and not this one...
Thanks
Upvotes: 0
Views: 107
Reputation: 6110
$('#calendar .fc-view-resourceNextWeeks thead th .fc-resourceName').addClass('top-cell');
should be
$('#calendar .fc-view-resourceNextWeeks thead th.fc-resourceName').addClass('top-cell');
(Note the removal of the space between th
and .fc-resourceName
)
The first one is looking for another element inside the th
with class .fc-resourceName
, while you actually want that element.
Upvotes: 1
Reputation: 74096
Change your selector, instead of:
'#calendar .fc-view-resourceNextWeeks thead th .fc-resourceName'
try:
'#calendar .fc-view-resourceNextWeeks thead th.fc-resourceName'
Upvotes: 2