jQuery UI Widgets › Forums › Scheduler › today highlight
This topic contains 7 replies, has 5 voices, and was last updated by thesled 4 years, 11 months ago.
-
Authortoday highlight Posts
-
so sorry if im a noob to this scheduler, most that i have explored, usually have this built in.
Anyone can help with highlighting the current date of the calender in schedulerHi geckus,
Unfortunately, it’s not possible to hightlight the current day in the jqxScheduler. You have the “Day” view that shows only one day. You can make it to show the current day if you set the
date
property to the current day. For example,date: new $.jqx.date(2016, 10, 17)
.Best Regards,
ChristopherjQWidgets Team
http://www.jqwidgets.comthanks for the reply. anyone know a quick workaround for it to highlight. like a workaround for css?
Hi geckus,
Unfortunately, there is no workaround we can suggest about this missing feature in our Scheduler component.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi,
We just got the jqwidgets-ver6.0.5.
Is hightlighting the current day in Monthview & Weekview available in the jqxScheduler now?
Hi,
I found a method to get current date highlighted.
Below are the lines which i used to do it.$(“#jqxScheduler”).jqxScheduler({
rendered: function () {
var currentdateval = moment().format(‘YYYY-MM-DD 00:00:00’);
$(‘[data-date=”‘ + currentdateval + ‘”]’).css(‘background’, ‘#f8efc8’);
}
});Thanks for the workaround Karthikeyan. Improving on your solution a bit…
- I would put the code in the “ready” callback rather than “rendered”, since rendered gets called multiple times (ready only gets called once)
- I suggest using the built-in jqx.date rather than adding the unnecessary “moment” library
- And just for good measure, use try/catch (as you always should)
So something like:
ready: function () { try { $('[data-date="' + new $.jqx.date().toString("yyyy-MM-dd 00:00:00") + '"]').css("background", "#f8efc8"); } catch (errMsg) { YourErrorHandler(errMsg); } }
Correction… adding the above code to “ready” function will cause the highlighted cell to reset (back to blank) when the view is updated (by opening edit dialog, etc.). So add the above code to the “rendered” function as Karthikeyan suggested.
-
AuthorPosts
You must be logged in to reply to this topic.