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

Apply filter on a second resource

4 Answers 20 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Luca
Top achievements
Rank 1
Luca asked on 24 Nov 2015, 08:08 AM

Hello!
I have a problem with filters in my scheduler: as shown in your base example,

I use a first filter applied on a member field called LabelTypeID (the same as OnwerID in your example).

My Model has a second (int ?) member called LabelID
In some case I have to filter only the LabelID (to select a single label, associated to the Calendar Event)

So, in my template I added a second resource for the LabelID, where the binding returns all possible labels:

.Resources(resource =>
 
  {
 
      resource.Add(m => m.LabelTypeID)
 
      .DataTextField("Text")
 
      .DataValueField("Value")
 
      .DataColorField("Color")
 
      .BindTo((new ACSDoorSignage.BIZ.LabelTypeBiz()).GetAllLabelTypesAsRazorArray(false));
 
  
      resource.Add(m => m.LabelID)
 
      .DataTextField("Text")
 
      .DataValueField("Value")       
 
      .BindTo((new ACSDoorSignage.BIZ.LabelBiz()).GetLabelsAsRazorArray(false));
        
  })

This is the filter that I try to use, where labelValue is one of the value returned in the binding (eg 1)

if (labelValue != -1) {
 
          var filter = {
 
              logic: "or",
 
              filters: new Array()
 
          };
 
          filter.filters.push(
 
           {
              operator: "eq",
 
              field: "LabelID",
 
              value: labelValue
 
          });
      }
 
      var scheduler = $("#scheduler").data("kendoScheduler");
 
      scheduler.dataSource.filter(filter);

 

The filter Always fails and I see on the browser:

Uncaught TypeError: (d.LabelID || "").toLowerCase is not a function

Can you help me to unserstand what happened?

If I'd like to apply a filter, MUST I Always define a resource for that filter?

 

4 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 26 Nov 2015, 09:02 AM
Hi Luca,

From the provided information it's not clear for us what exactly you are trying to achieve:
  • Filter the Resource DataSource on editing
  • Filter the Scheduler DataSource

Could you please elaborate more on this? This would help us get better overview of the exact setup that you have and advice you better how to proceed. 

Regards,
Vladimir Iliev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Luca
Top achievements
Rank 1
answered on 26 Nov 2015, 09:04 AM
I solved via ticket support...I'm sorry!
0
K.Ramadan
Top achievements
Rank 2
Veteran
answered on 03 Mar 2020, 03:16 PM
can you maybe post the solution here so that others can benefit from it ?! I know I'm like 5 years late .. but I am now stuck at this point and can't move forward .. thx
0
Martin
Telerik team
answered on 05 Mar 2020, 11:30 AM

Hello Lu,

I believe that the issue has been resolved in the support thread 1455014. If you are still experiencing any issues, please get back to me in the support ticket so that the communication would go fluently in a single thread.

Regards,
Martin
Progress Telerik

Get quickly onboarded and successful with your Telerik UI for ASP.NET MVC with the dedicated Virtual Classroom technical training, available to all active customers.
Tags
Scheduler
Asked by
Luca
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Luca
Top achievements
Rank 1
K.Ramadan
Top achievements
Rank 2
Veteran
Martin
Telerik team
Share this question
or