lema Posted November 17, 2021 Share Posted November 17, 2021 Hello ! As title says, is there any way to select -or mark- a week in uniCalendar (as screenshot below). No need to get the range, or dynamically selection. I just want to use it in conjunction with uniCalendarPanel (in week mode). (running v.1.90.0.1554) TIA, Lefteris. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 17, 2021 Share Posted November 17, 2021 Hello, 1 hour ago, lema said: Do you want to color the row for the selected date? Quote Link to comment Share on other sites More sharing options...
lema Posted November 17, 2021 Author Share Posted November 17, 2021 9 hours ago, Sherzod said: Hello, Do you want to color the row for the selected date? Hello ! Yes, exactly that. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 17, 2021 Share Posted November 17, 2021 28 minutes ago, lema said: Yes, exactly that. I will post here, later Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 17, 2021 Share Posted November 17, 2021 17 minutes ago, Sherzod said: I will post here, later 1. UniServerModule.CustomCSS: .customTr { background-color: yellowgreen; transition: all 0.3s ease-in; } 2. MainForm.Script: Ext.override(Ext.DatePicker, { update: function(date, forceRefresh) { var me = this; this.callParent(arguments); Ext.defer(function() { me.fireEvent("select"); }, 200); } }); 3. UniCalendar -> ClientEvents -> ExtEvents -> function picker.select(sender, date, eOpts) function picker.select(sender, date, eOpts) { var me=this; me.getEl().select('tr').each(function(el) { el.removeCls('customTr') }); Ext.defer(function() { me.getEl().select('.x-datepicker-selected').each(function(el) { el.up('tr').addCls('customTr') }) }, 0); } 2 1 Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted November 17, 2021 Share Posted November 17, 2021 Many Thanks Maestro. You should edit a book : "Developing Client Side with Unigui" and i will buy it 1 Quote Link to comment Share on other sites More sharing options...
lema Posted November 17, 2021 Author Share Posted November 17, 2021 Thank you ! I didn't try it yet, but it is really impressive that you can analyze, find and implement it so fast. Also, I wish, I could understand that JavaScript stuff... I wonder, where can I find such information? Sencha Ext JS docs? forums? Could you please give me a hint? Quote Link to comment Share on other sites More sharing options...
lema Posted November 17, 2021 Author Share Posted November 17, 2021 1 hour ago, Abaksoft said: Many Thanks Maestro. You should edit a book : "Developing Client Side with Unigui" and i will buy it Not a bad idea ! Quote Link to comment Share on other sites More sharing options...
lema Posted May 31, 2023 Author Share Posted May 31, 2023 Hello dear Sherzod. I'm returning to this topic, because the code below seems to be affecting also the UniDateTimePicker components on the form. It works perfect for the uniCalendar, but the menu of the DateTimePicker control opens and closes automatically, not allowing the user to select a date. Ext.override(Ext.DatePicker, { update: function(date, forceRefresh) { var me = this; this.callParent(arguments); Ext.defer(function() { me.fireEvent("select"); }, 200); } }); Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 1, 2023 Share Posted June 1, 2023 Hello @lema How can I reproduce this issue? Quote Link to comment Share on other sites More sharing options...
lema Posted June 2, 2023 Author Share Posted June 2, 2023 Hello dear @Sherzod I am sending a sample. I used the CalendarPanel example, adding the scripts above. You cannot use the UniDateTimePicker controls in "Add/Edit Event" form. They popup and close immediately.... Obviously, the MainForm.Script causes this problem. Can you suggest any workaround? uniCalendar.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 3, 2023 Share Posted June 3, 2023 Thanks for the testcase, I will try to check it. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 3, 2023 Share Posted June 3, 2023 14 hours ago, lema said: You cannot use the UniDateTimePicker controls in "Add/Edit Event" form. They popup and close immediately.... Hello, Okay, 1. Remove script from MainForm.Script 2. UniCalendar1.ClientEvents.UniEvents -> Ext.picker.Date [picker] function picker.beforeInit(sender, config) { Ext.override(sender, { update: function(date, forceRefresh) { var me = this; this.callParent(arguments); Ext.defer(function() { me.fireEvent("select"); }, 200) } }); } Quote Link to comment Share on other sites More sharing options...
lema Posted June 3, 2023 Author Share Posted June 3, 2023 @Sherzod, you make it look very easy ! Thank you ! 1 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.