This is a migrated thread and some comments may be shown as answers.

Scheduler event size

8 Answers 212 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Abradax
Top achievements
Rank 1
Abradax asked on 30 Sep 2014, 08:55 PM
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.

8 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 02 Oct 2014, 03:03 PM
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.

 
0
Abradax
Top achievements
Rank 1
answered on 02 Oct 2014, 06:51 PM
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?
0
Alex Gyoshev
Telerik team
answered on 03 Oct 2014, 09:55 AM
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.

 
0
Abradax
Top achievements
Rank 1
answered on 03 Oct 2014, 07:08 PM
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)

0
Alex Gyoshev
Telerik team
answered on 06 Oct 2014, 11:33 AM
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.

 
0
Abradax
Top achievements
Rank 1
answered on 06 Oct 2014, 11:49 AM
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.
0
Accepted
Alex Gyoshev
Telerik team
answered on 06 Oct 2014, 12:39 PM
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.

 
0
Abradax
Top achievements
Rank 1
answered on 06 Oct 2014, 05:26 PM
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.
Tags
Scheduler
Asked by
Abradax
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Abradax
Top achievements
Rank 1
Share this question
or