erich.wanker Posted February 18, 2019 Share Posted February 18, 2019 Hello, how can i change the Background Color of the actual selected day (which i clicked..) in UniCalendarPanel1 - MONTH VIEW ... ? thanX Erich Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted February 19, 2019 Share Posted February 19, 2019 +1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 19, 2019 Share Posted February 19, 2019 19 hours ago, erich.wanker said: how can i change the Background Color of the actual selected day (which i clicked..) in UniCalendarPanel1 - MONTH VIEW ... ? Hello Erich, Sorry, can you explain in more details? Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted February 19, 2019 Share Posted February 19, 2019 On this thread, you can see, selected date 31 october 2018, in uniCalendar, on left side. How to show this selected day in uniCalenderPanel ? for example, can you tell me, which day is selected day (cell) on screenshot ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 19, 2019 Share Posted February 19, 2019 13 minutes ago, Freeman35 said: can you tell me, which day is selected day (cell) on screenshot ? Hi, I don't need this, I just do a click where I need Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted February 19, 2019 Share Posted February 19, 2019 yes, its a another view point But we need it Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted February 19, 2019 Author Share Posted February 19, 2019 hi .. same like Freeman35 wants .. in your demo-app i clicked the "6 februar 2019" .. but the user can not see - what date is selected ... the "actual selected date" should be highlighted .... Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted February 19, 2019 Author Share Posted February 19, 2019 ... a other "dirty" solution: i can draw a event on the clicked day ... very easy ... Please use a ChromeBrowser to see the video to understand what i mean .... calendar.webm Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 19, 2019 Share Posted February 19, 2019 30 minutes ago, erich.wanker said: ... a other "dirty" solution: i can draw a event on the clicked day ... very easy ... Sorry, I did not quite understand Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 19, 2019 Share Posted February 19, 2019 1 hour ago, Freeman35 said: On this thread, you can see, selected date 31 october 2018, in uniCalendar, on left side. How to show this selected day in uniCalenderPanel ? Maybe something like this? procedure SetBG(ACalendarPanel: TUniCalendarPanel; ADate: TDateTime); procedure TMainForm.SetBG(ACalendarPanel: TUniCalendarPanel; ADate: TDateTime); begin with ACalendarPanel do begin JSInterface.JSCode(#1'.getEl().select(''.x-calendar-weeks-cell'').elements.forEach(function(el){el.style["background-color"]=""});'); JSInterface.JSAssign('selDate', [FormatDateTime('YYYY-mm-dd', ADate)]); JSInterface.JSCode('me='#1'.getEl().select(''.x-calendar-weeks-cell[data-date="''+'#1'.selDate+''"]'').elements[0]; if(me){me.style["background-color"]="green"};'); end end; procedure TMainForm.UniCalendar1Click(Sender: TObject); begin UniCalendarPanel1.StartDate := UniCalendar1.Date; SetBG(UniCalendarPanel1, UniCalendarPanel1.StartDate); end; procedure TMainForm.UniCalendarPanel1DateChange(Sender: TUniCalendarPanel; StartDate, ViewStart, ViewEnd: TDateTime); begin UniCalendar1.Date := UniCalendarPanel1.StartDate; SetBG(UniCalendarPanel1, UniCalendarPanel1.StartDate); end; procedure TMainForm.UniCalendarPanel1ViewChange(Sender: TUniCalendarPanel; CurrentView: TUniCalendarViewType); begin if CurrentView = cvMonth then SetBG(UniCalendarPanel1, UniCalendarPanel1.StartDate); end; ... Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted February 19, 2019 Author Share Posted February 19, 2019 hi Sherzod, works PERFECt !! ThanX panel_color_change.webm Quote Link to comment Share on other sites More sharing options...
donlego Posted September 17, 2020 Share Posted September 17, 2020 how to focus on a specific date when form oncreate example color become green on 2nd date the code is alway focus on first date Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.