IgniteUI / ignite-ui

Ignite UI for jQuery by Infragistics
https://bit.ly/2kuu1fT
Other
477 stars 84 forks source link

View modes not rendered on Scheduler when property set on model #2256

Open paulmoore1 opened 3 months ago

paulmoore1 commented 3 months ago

Description

When the view mode for a Scheduler is set on the model in ASP.NET Core, it fails to render correctly. From inspecting the behaviour in the console, this appears to be because the viewMode variable in the JavaScript is all lowercase e.g. "monthview" instead of "monthView". This means that it fails to be matched correctly (see attached screenshot).

Steps to reproduce

(code sample attached)

  1. Make a model that extends the Infragistics SchedulerModel

    public class UISchedulerModel : SchedulerModel
    {
    public UISchedulerModel(IEnumerable<UISchedulerAppointmentModel> appointments, IEnumerable<SchedulerViewMode> views = null)
    {
    DataSource = appointments.AsQueryable();
    Views = views?.ToList() ?? new List<SchedulerViewMode>();
    }
    }
  2. Render the model in a view using the SchedulerWrapper

    
    @using Infragistics.Web.Mvc
    @model Program.Namespace.UISchedulerModel
    @{
    SchedulerWrapper myScheduleWrapper = new SchedulerWrapper(Html)
    {
    Model = Model
    };
    }

@(myScheduleWrapper.Render())



4. ...

## Result  
If the views parameter passed in to the model is null, then the scheduler renders correctly. 
If a value is set for the views e.g.
`IEnumerable<SchedulerViewMode> viewModes = new List<SchedulerViewMode>() { SchedulerViewMode.MonthView, SchedulerViewMode.AgendaView };` then the scheduler fails to render

## Expected result  
The scheduler is rendered correctly whatever view modes are set.

## Attachments  
[igScheduler.zip](https://github.com/IgniteUI/ignite-ui/files/14695809/igScheduler.zip)

Target result:
![Target rendering](https://github.com/IgniteUI/ignite-ui/assets/23409711/9acd558e-8c8f-4362-96f3-4800e5e5221d)

Actual result (failed rendering):
![Failed rendering](https://github.com/IgniteUI/ignite-ui/assets/23409711/76a50923-09d7-4c77-9e1e-9e9723571230)

Console error:
![Error in console](https://github.com/IgniteUI/ignite-ui/assets/23409711/399d06db-8ba8-4f96-94b4-433060f15b2a)