Scheduler event size

9 posts, 1 answers
  1. Abradax
    Abradax avatar
    14 posts
    Member since:
    Feb 2014

    Posted 30 Sep 2014 Link to this post

    Hi.

    I'm using scheduler to make a workforce calendar for my department, there are approximately 100 people across three shifts.

    I have everything working, however in day and month view, as you can imagine, the shifts are extremely narrow.

    Is there a way to make the scheduler scroll able horizontally with the events as a fixed size so that they display properly?

    I did a CSS style on k-event, and it did make the events wider, however now they overlap each other instead of scrolling out the schedule.
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 02 Oct 2014 Link to this post

    Hello Robert,

    Perhaps the solution from this forum thread will help in this case?

    Regards,
    Alex Gyoshev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Abradax
    Abradax avatar
    14 posts
    Member since:
    Feb 2014

    Posted 02 Oct 2014 in reply to Alex Gyoshev Link to this post

    Thank you,

    That code gets me extremely close to what I am trying to accomplish.

    I do have my calendar filterable based on a few multiselect boxes, so my calendar can grow and shrink based on what the user selects.

    Since this can display one record or potentially a couple of hundred, hard coding a width doesn't work too well.  I plan on using Jquery to adjust the widths as detailed in the thread you posted on navigate or filter to calculate the number of items and then set my width accordingly, unless there is an easier way to accomplish that?
  5. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 03 Oct 2014 Link to this post

    Hello Robert,

    I don't think that there is an easier way to achieve this. You should be able to use the dataBound event to re-calculate the widths accordingly.

    Regards,
    Alex Gyoshev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Abradax
    Abradax avatar
    14 posts
    Member since:
    Feb 2014

    Posted 03 Oct 2014 in reply to Alex Gyoshev Link to this post

    Thanks again Alex, I am only one step away from what I detailed in my original post.

    I have a function that adjusts the width on databinding, and on filter, however when the size changes, the calculated size is the entire dataset's item width instead of the filtered version.

    I added a watch point and can see that the dataSource object has a _data property with my filtered items, but for some reason, I just can't get to the count so I can calculate this correctly.

    If you could give me a tip here, this project will finally be complete! (YAY)

  7. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 06 Oct 2014 Link to this post

    Hello Robert,

    If I understand correctly, you need the count of the filtered items? If that is the case, you can get it through the view method (which returns the collection of filtered items) and get its length, like so:

        var filteredItemsCount = this.dataSource.view().length;

    If that is not what you are looking for, please clarify.

    Regards,
    Alex Gyoshev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  8. Abradax
    Abradax avatar
    14 posts
    Member since:
    Feb 2014

    Posted 06 Oct 2014 in reply to Alex Gyoshev Link to this post

    That was what I was looking for, I found it this weekend, and figured out where the problem is:

    I am using a system of filters based on multiselect boxes to filter the events:

    //Employee Filter array correction
        if (empvalues.length > 0) {
            $.each(empvalues, function (i, v) {
                empfilter.filters.push({ field: "Employee.EmployeePic", operator: "eq", value: v });
            });
        } else {
            empfilter = {field: "Employee.EmployeePic", operator: "neq", value: "InvalidString"};
        }
     
        //Status Filter array correction
        if (statvalues.length > 0) {
            $.each(statvalues, function (i, v) {
                statfilter.filters.push({ field: "Status.StatusSeq", operator: "eq", value: v });
            });
        } else {
            statfilter = { field: "Status.StatusSeq", operator: "neq", value: -1 };
        }
     
        //Access Filter array correction
        if (accvalues.length > 0) {
            $.each(accvalues, function (i, v) {
                accfilter.filters.push({ field: "EmployeeAccessLevelScheduler", operator: "eq", value: v });
            });
        } else {
            accfilter = { field: "EmployeeAccessLevelScheduler", operator: "neq", value: -1 };
        }
     
        var filter = {
            logic: "and", filters: [empfilter, statfilter, accfilter]
        };
     
        dataSource.dataSource.filter(filter);
        AdjustMasterScheduleGridSize();


    It works everywhere except for one instance, and that is when Clear all boxes.  When I watch the watchpoint, after clearing all three boxes, the entire datasource pulls through, and not just the one based on the view I am currently in.

    So while my day view should have 56 items for instance, it has all 335.

    Since I am applying the filter that pulls all items, it makes sense, but after applying that filter, I need to get the scheduler to recognize which view is selected and limit the results again, and I'm unsure how to accomplish that feat.  I think that was my problem last week also, as with this revelation I noticed if after clearing my filter, if I click the view button again, the schedule adjusts itself appropriately.
  9. Answer
    Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 06 Oct 2014 Link to this post

    Hello Robert,

    Do you mean that the view filters are not applied after clearing the dataSource filters? Can you please provide a sample (no need for services, plain mocked data will do)?

    Regards,
    Alex Gyoshev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  10. Abradax
    Abradax avatar
    14 posts
    Member since:
    Feb 2014

    Posted 06 Oct 2014 Link to this post

    Thanks for all of your help with this.  I finally got the schedule to do what I wanted.

    I use a combination of the code you provided and a ton of trial and error lol.

    I ended up using Server Filtering with a change event to calculate the items that are being returned based on the filter.  I never did see the view filter as part of the transmission to my controller, so not sure what happened there, but it definitely works.  I added a small date calculation to handle the missing view filter, and now I have a fully functional dynamic calendar.
Back to Top
UI for ASP.NET MVC is VS 2017 Ready