ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: youngfitz on October 16, 2018, 04:06:48 pm
-
Hi,
I created a text custom condition for a Datetime Field but its not passing the value back because i suspect its a text value associated with date type property.
Is there anyway around this?
Thanks
-
Hi,
Apologises for pushing on this but did you get a chance to review?
FYI - We will be purchasing 3 licenses tomorrow.
Thanks
-
Filter custom conditions are designed for and tested with local filtering.
I guess you are using it for remote filtering. Could you please share your custom text condition and column definition so that I can check it.
-
Hi,
Thanks for the reply. Yes, its for remote filtering. Below is the code to add the condition:
pq.filter.conditions.fallswithdays = {
filter: {
attr: "",
cls: "",
style: "",
type: 'textbox',
init: pq.filter.textbox
},
date: 1,
number: 1,
stringList: 1,
}
}
$.paramquery.pqGrid.defaults.strConditions.fallswithdays = "Falls within (days)";
This is added to a Property which is a Date Field. The standard conditions work correctly.
The controller method is hit but the pq_filter variable is always null.
The user wants to be able to save a grid with a INTEGER value and show records with a date period from the day the grid loads + the INTEGER value added -
So basically "DateField"<= Datetime.Now.AddDays(INTEGER VALUE).
Any help would be great.
Thanks
-
Hi,
From further testing, it successfully will pass back the value when I use contains, EndsWidth etc... basically any of the built in existing conditions so it looks like when its a custom Condition, it does not pass it back.
Hope that helps.
Thanks
-
Hi,
Can this be moved to "Help for ParamQuery Pro" as the licenses were purchased. A seperate ticket was raised detailing the transaction ID and account details.
Thanks
-
Could you please recheck the values in network console of your browser.
It's passing the value fine in my test by using fallswithdays for OrderDate column in this example for remote filtering:
https://paramquery.com/pro/demos/filter_header
pq_filter: {"mode":"AND","data":[{"dataIndx":"ContactName","dataType":"string","value":"M","condition":"begin"},{"dataIndx":"ShipRegion","dataType":"string","value":["RJ"],"condition":"range"},{"dataIndx":"OrderDate","dataType":"date","value":"8","condition":"fallswithdays"}]}
_: 1540211384537
In order to process it on server, you would need to add the logic for the new condition in deSerializeFilter method in your remote FilterHelper class.
-
Hi,
I checked my network console and the pq_filter is not been passed back at all when I filter on the date with a INTEGER value. (see attached FallswithinDays.zip).
I checked another custom condition which is NOT for date fields and that passes it back successfully.
See attached(OtherCustomerConditionWorking.zip) where there is 2 columns been filtered - both custom conditions but only 1(days remaining is been passed back) is been passed.
In your check, did you create a new custom filter or rename an existing filter? I know your existing filters will work, it seems when its a custom filter, I experience the problem.
I understand I need to create the filter logic in the deSerializeFilter method but the issue is with the pq_filter string not been passed back.
I have also attached the JS used to create the custom condition.
Thanks
-
In your check, did you create a new custom filter or rename an existing filter? I know your existing filters will work, it seems when its a custom filter, I experience the problem.
In my test, I created a new custom filter condition.
I've created a live test case in plnkr for verification.
https://plnkr.co/edit/hhtFUtQ0gZfPz0Icq0bw?p=preview
If you are still facing issue, please share a live test case so that I can check it for you.
-
Hi,
Thanks for this. I found the issue. I set the format of the date field to be "dd-mm-yy" and this causes the issue when passing a non date value.
In your example, i added format:'dd-mm-yy' to the OrderDate and I could see the the network console that the filter was not passed.
Is there potentially another way to setting the format of dates?
Thanks
-
Ok, got it.
Please remove date: 1 and add dateList: 1 in the filter definition.
pq.filter.conditions.fallswithdays = {
filter: {
attr: "",
cls: "",
style: "",
type: 'textbox',
init: pq.filter.textbox
},
dateList: 1
}
Working fine now:
https://plnkr.co/edit/hhtFUtQ0gZfPz0Icq0bw?p=preview
-
Hi,
Thanks for this. I have it working now.
You can close the ticket.
Thanks