Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - gmswsd

Pages: [1] 2 3
1
Help for ParamQuery Pro / Re: Filtering issue
« on: June 22, 2020, 08:10:21 pm »
We want the global filter to work with the local column filter but once the global filter uses "contains", the local filters no longer use "range" as we want. As well, if the user uses the "range" to see only certain data, the global filter will overwrite those conditions. We believe this cannot be achieved because of prefiltering, as the filterhandler function doesn't work as we intended.

Here is a jsfiddle: https://jsfiddle.net/WebSalesDesign/6oucdvz9/33/

2
Help for ParamQuery Pro / Filtering issue
« on: June 19, 2020, 07:41:00 pm »
Hi,
There is an issue with the pq plugin that it prefilter the data before triggering the filter handler function:
 
This screenshot contains the output of filterhandler with all lines commented except for the first console log, the function received the original filters:
(see attachment- output_filterhandler)
 
When we uncomment the other lines, the first console log function shows filters after applying the new one:
(see attachment- console_log)
 
Also, when we use timeout handler, it triggers the function on losing focus again:
{
     type: 'textbox',
     label: 'Filter: ',
     attr: 'placeholder="Enter your keyword"',
     cls: "filterValue",
     listener: {timeout: filterhandler} --> Timeout calls the function twice after the input field loses focus
},
(see attachment- timeout)
 
Here's the function implementation:
function filterhandler(e, u) {
                console.log(this.getColModel()); --> This is called after filtering
                var $toolbar = this.toolbar(),
                    $value = $toolbar.find(".filterValue"),
                    value = $value.val(),
                    condition = $toolbar.find(".filterCondition").val(),
                    dataIndx = $toolbar.find(".filterColumn").val(),
                    filterRules;
                if (e.currentTarget.className == "filterColumn" || e.currentTarget.className == "filterCondition" && value == '') return;
                if (dataIndx == "") {//search through all fields when no field selected.
                    filterRules = this.getColModel().map(function (column) {
                        return {dataIndx: column.dataIndx, condition: condition, value: value};
                    })
                } else {//search through selected field.
                    filterRules = [{dataIndx: dataIndx, condition: condition, value: value}];
                }
                // reset to range if text is empty
                if (value == '') {
                    if (Array.isArray(filterRules)) {
                        filterRules = filterRules.map((rule) => {
                            return { ...rule, condition: 'range'}
                        });
                    } else {
                        filterRules.condition = 'range';
                    }
                }

                //call to grid filter method.
                this.filter({
                    oper: 'add',
                    mode: 'OR',
                    rules: filterRules
                }); --> This is called first!
            }
 
We tried as well implementing beforeFilter, it's still called after filtering:
beforeFilter: function (e, u) {
   console.log(u); --> This is called after filtering
},

3
Help for ParamQuery Pro / Re: Search bar and filter model
« on: June 06, 2020, 03:09:49 am »
What I mean by break is that the filter crules change from 'range' to 'contain' because of the global filter, so the user cannot use the filter function as 'range' without refreshing. Is it possible to have the global filter change the crules back to 'range' after each search? Or to have the filter checkbox change the filter to range instead of just turning the header on/off?

I cannot see how to change the filterhandler function so it excludes the date column. Can you share how to do this?

4
Help for ParamQuery Pro / Re: Search bar and filter model
« on: June 05, 2020, 12:13:08 am »
Sure. If I use the filter part to filter on rank for example, only showing number 1, then I use the global search, then I erase the search, then I use the over-due function, then the filter column breaks. I attached a photo.

6
Help for ParamQuery Pro / Search bar and filter model
« on: June 03, 2020, 12:25:03 am »
Hi,

When I use the global search bar when specific columns have a filter placed, the search will work but then after those columns still have the values as if they are being filtered on, but they are not. Is there a way to clear the filters during the search, or to have the search save those filters and re-apply them after?

Thanks

7
Thanks once again Paramvir,
This works.
I originally used array to reduce data size and increase speed, however I will switch it over to json data like you suggested.

8
Thanks paramvir, 
The filter and checkbox work perfectly now if the columns don't move.  When columns move it no longer works.
Here is the jsfiddle: https://jsfiddle.net/WebSalesDesign/hcw512dk/6/

9
Hi Paramvir,
Struggling with this.
Tried a number of combinations. 
How do I get the column object?
How do I know if the checkbox is checked or not?
How do I clear this filter when it is unchecked?



                        {
                            type: 'checkbox',
                            label: "Over Due",
                            listener: function () {
                                this.colModel.filter({
                                    oper: 'replace',
                                    rules: [
                                        {
                                            dataIndx: 'Due Date',
                                            mode: "AND",
                                            crules: [
                                                {condition: "less", value: new Date()}, //set initial value of filter
                                                {condition: "notempty"}]
                                        }]
                                })
                            }
                        },


10
Thanks Paramvir,
That worked.

11
Thanks Paramvir,
How do you assign a unique id to a grid?

12
Thanks paramvir,
That works great when loading, however how can that filter be turned on and off based on a checkbox in the toolbar?

13
Hi

When building the colModel the below will show records where the due date is less than today, however it still shows blank values.
I tried notempty but could not get it to work.
Also how can I put this in a checkbox in the toolbar.

{title: "Due Date", width: 30, dataType: "date", filter: {
crules: [
{ condition: "less", value: new Date()}, //set initial value of filter
{ condition: "great", value: ""}
]
}},

14
Help for ParamQuery Pro / Restore State when using multiple grids
« on: May 17, 2020, 10:12:36 am »
Hi
Save state works great when using a single grid, however when using another grid on a different tab it uses the state from the initial grid.
Is there a way to still save to the cookie but give it the name of the grid?
Also, if I have a filter from filterModel saved it saves the filter it just doesn't execute on the filter when restored.

15
Thanks paramvir
That worked perfectly.
That and making it a single array.

Pages: [1] 2 3