ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: JUNZHONG on April 07, 2016, 11:17:10 pm

Title: paramquery grid date filter with null value
Post by: JUNZHONG on April 07, 2016, 11:17:10 pm
Hi,
We have date filter on the grid as -
{ title: "Next Cal", width: 165, dataType: "date", dataIndx: "NEXT_CAL",
                       render: function (ui) {if (ui.cellData == null) return null; else return $.datepicker.formatDate('mm/dd/yy', new Date(Date.parseExact(ui.cellData,'d-MMM-yyyy')));},
                        filter: { type: 'textbox', condition: "between", init: pqDatePicker, listeners: ['change']  }
                   },


This field allows null so we have few records with empty/null date.
When we filter with end date, the row with null date shows up too. It should not show up. Please help.
Title: Re: paramquery grid date filter with null value
Post by: paramvir on April 08, 2016, 08:53:08 am
This example http://paramquery.com/pro/demos/filter_header_local has empty values "" in the Shipped Date column.

It works fine, you can check by copying the between filter from Order date column to Shipped data column.

You might have to replace null values with ""
Title: Re: paramquery grid date filter with null value
Post by: JUNZHONG on April 08, 2016, 07:36:26 pm
I tried with "" empty date but still doesn't work for me. Your example work but not my code. Seems like it is getting converted to date "12/31/1969". Not sure why. We are using 2.2 version.

filterModel: { header: true, type: 'local' }
Title: Re: paramquery grid date filter with null value
Post by: paramvir on April 11, 2016, 09:37:54 am
It also works fine in v2.4

http://paramquery.com/pro/demos24/filter_header_local

Could you please share a jsfiddle.
Title: Re: paramquery grid date filter with null value
Post by: JUNZHONG on April 13, 2016, 01:12:37 am
I found the issue. I was using date.js which was causing all the issues.
Thanks for your help.