We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

QueryBuilder with DatePicker - throws error "Cannot read property 'match' of null"

Thread ID:

Created:

Updated:

Platform:

Replies:

144240 Apr 26,2019 04:35 AM UTC Apr 30,2019 04:48 AM UTC ASP.NET Core - EJ 2 3
loading
Tags: Query Builder
moez
Asked On April 26, 2019 06:15 PM UTC

Hello
I have a QueryBulder with 3 filters, two of them are of datatype string, and the last one of type date. The QueryBuilder is not bound to any data source.
I'm trying to get the filters/query generated by the component at runtime as follow:

//get the query builder object using the component's id
predicate = queryBuilderComponent.getPredicate(queryBuilderComponent.rule);
if (ej.base.isNullOrUndefined(predicate)) {
     dataManagerQuery = new ej.data.Query();
} else {
     dataManagerQuery = new ej.data.Query().where(predicate);
}

I get the following error whenever the getPredicate method is called (line 2 in the code above).
I noticed that if I select any value in the date picker corresponding to the 3rd filter (of type date), then I do not get the error.
Any ideas what I'm doing wrong ?
Thanks !

Vinoth Kumar Sundara Moorthy [Syncfusion]
Replied On April 29, 2019 01:54 PM UTC

Hi Moez, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your reported issue and we suspect that you have not specified the date ‘value’ in the QueryBuilder rule caused this error. Please check the below code example to resolve the reported issue in your end, 
 
[QueryBuilderController.cs] 
new QueryBuilderRule { Label="First Name", Field="FirstName", Type="string", Operator="startswith", Value = "Sam" }, 
                    new QueryBuilderRule { Label="Title", Field="Title", Type="string", Operator="equal", Value = "Sales Manager" }, 
                    new QueryBuilderRule { Label="Hire Date", Field="HireDate", Operator="equal", Type="date", Value = "29/04/2019" } 
 
 
Could you please check the above sample and get back to us, if you still need any further assistance on this? 
 
Regards, 
Vinoth Kumar S 


moez
Replied On April 29, 2019 08:21 PM UTC

Great, thanks Vinoth !
I'll add the data type and the default value and try again.

Vinoth Kumar Sundara Moorthy [Syncfusion]
Replied On April 30, 2019 04:48 AM UTC

  
Hi Moez, 
 
Thank you for your update. We will be waiting to hear from you. 
 
Regards, 
Vinoth Kumar S 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon