Premium support for our pure JavaScript UI components


Post by sameer1710 »

Hi,

I have added a date picker for scheduler along with view preset combo and ['hourAndDay', 'weekAndDay', 'dayAndMonth', 'monthAndYear'] as the available presets.

The date picker comes with an option to scroll using the forward and backward arrows but for some reason, only backward arrow is working and forward is not.

For example, If the selected date is 2023-07-23 and the preset selected is weekAndDay, when I click on back arrow, it takes the scheduler to previous week but clicking the forward icon does not move the scheduler.

can you please suggest?

Below are my date picker and preset combo field definitions.

{
            inputWidth : '8em',
            type       : 'datefield',
            id         : 'beer30scheduler_selected_date',
            value      : today,
            step       : '1d',

        // SAMEER_A [2023-04-12, 13:06] :: Add custom class to the parameter
        cls        : 'scheduler-select-date-input',

        listeners :
        {
            change({ userAction, value })
            {
                if (userAction)
                {
                    //beer30Scheduler.scrollToDate(dateHelper.set(value, 'hour', 12), { block : 'center', animate : 500 });
                    beer30Scheduler.loadTasks();
                }
            }
        },
        highlightExternalChange : false
    },

    // SAMEER_A [2023-04-12, 13:06] :: Combolist for loading multiple view types
    {
        type : 'viewpresetcombo',
        id : 'beer30scheduler_preset_combo',
        inputWidth : '8em',
        presets: ['hourAndDay', 'weekAndDay', 'dayAndMonth', 'monthAndYear'],
        listeners :
        {
            // SAMEER_A [2023-04-18, 16:57] :: Function to show/hide fields linked to task type dataset
            select: () =>
            {
                beer30Scheduler.loadTasks();
            }
        }
    },

Post by alex.l »

Hi sameer1710,

Could you please check if you shared correct code version? I don't see any code to change timeSpan in scheduler timeline, only load some data. The commented lines also doesn't seems to be valid in case you didn't use infiniteScroll enabled. Please see this demo https://bryntum.com/products/schedulerpro/examples/maps/
it has such field and code that you can review.

    onDateFieldChange({ value, userAction }) {
        userAction && this.setTimeSpan(DateHelper.add(value, 8, 'hour'), DateHelper.add(value, 20, 'hour'));
    }

All the best,
Alex


Post by sameer1710 »

This is resolved.


Post Reply