setEntryContentCallback - can't read properties of style.
Closed this issue · 3 comments
Bug Description
Hi all,
I try to customise event's style in calendar, and use the piece of code from samples :
calendar.setEntryContentCallback("" +
"function(info) {" +
" info.el.style.color = 'red';" +
" return info.el; " +
"}"
);
I found multiple syntax, and spent hours to get it work without success !
Could someone help ?
In this case the solution that I adopt to find the problem is to print and dig into the info object.
calendar.setEntryContentCallback("" +
"function(info) {" +
" console.log(info);" +
"}"
);
The examples are not up to date, as you can read here in the Argument section the el object is only avaiable with eventDidMount
and eventWillUnmount
To use the el object and change the syle you need to use: setEntryDidMountCallback
Final result:
calendar.setEntryDidMountCallback("" +
"function(info) {" +
" info.el.style.color = 'red';" +
" return info.el; " +
"}"
);
Wiki page is not up to date
Aetasoul, I want to marry you :)
Perfect !! And answer so quicly !!
Thank you very much !