Author Topic: row lines not showing and reset filter not working Not Empty/Empty condition  (Read 6345 times)

kshipra

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 94
    • View Profile
Hi,

I recently upgraded grid to 5.5. I like new filters.

1. One thing I noticed was reset filter code is not working when condition is selected to "Empty/NotEmpty"
https://paramquery.com/pro/demos/filter_header_local


2. https://paramquery.com/pro/demos/readonly_cells

On country column in this example the rows grid lines - outer border is not showing. I would like the cell lines to show properly. It was working properly in older 3.4 version.

3. sorting not working properly
In 3.4 you can click anywhere in column header for sorting
https://paramquery.com/pro/demos33/sorting

In 5.5 - column is sorted only when clicked on the name hyperlink , does not work as in previous 3.4 version
« Last Edit: November 08, 2018, 12:38:18 pm by kshipra »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Thanks for your feedback.

1. What exactly you mean by reset filter not working for Empty / Not Empty. What's your suggestion.

2. Please add border-bottom-color: inherit; for now as updated in the demo.

https://paramquery.com/pro/demos/readonly_cells

3. It is intentional to click on the header title for sorting.

kshipra

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 94
    • View Profile
1. What exactly you mean by reset filter not working for Empty / Not Empty. What's your suggestion.
In the demo  -  https://paramquery.com/pro/demos/filter_header_local  - there is Reset filters button. How I understand this reset filters functionality works is it should reset all the filters selected by user.  So user does not have to manually undo the filtered values entered. I have similar functionality implemented. It is working for other conditions in different filters but not for above 2 mentioned conditions, which I think is a bug.

2. Thanks for quick css help.

3. It is intentional to click on the header title for sorting. - 
I would like to understand why it was changed to click only on column names for sorting ? I need to explain to users.
Users that are used to old way of sorting on column headers are going to complain that sorting does not work. I can see my users complaining already. Is there any way that you can make it backward compatible ?





paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
1. Ok, moving it to bug log.

3. It's changed from ergonomic point of view and to prevent accidental sort of column while trying to click the column header menu, resize column. Also click on column header might be reserved to select columns in upcoming versions. I would check if it can be made backward compatible ( via an option in sortModel )

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
1 and 2 are fixed in v5.6.0

FOR 3, you can use sortModel.wholeCell

kshipra

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 94
    • View Profile
Thank you for quick fix. I will get the new version.

kshipra

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 94
    • View Profile
I downloaded 5.6 and tried reset filters. It is not working at all now. The code is blowing

This is how i have defined default filters for all columns.

 columnTemplate: { filter: { crules: [{ condition: "contain" }, {}] } },
                    filterModel: {
                        on: true,
                        mode: "AND",
                        header: true,
                        menuIcon: true //show filter row icon initially.
                    },

Reset filter button code:
 {
                                type: 'button',
                                label: 'Reset filters',
                                listener: function() {
                                    this.reset({ filter: true });
                                    //$('.filterValue').val("");
                                }
                            },

Internally pqgrid is throwing error:

clearFilters: function(t) {
            t.forEach(function(t) {
                var e = t.filter
                  , n = pq.filter.conditions;
                e && (e.crules || []).forEach(function(t) {
                    n[t.condition].nr && (t.condition = void 0),     -----------------------> Uncaught TypeError: Cannot read property nr of undefined.
                    t.value = t.value2 = void 0
                })
            })
        },


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
It looks like error is caused by empty condition in crules definition.

Please use this:

Code: [Select]
  crules: [{ condition: "contain" }]

instead of

Code: [Select]
  crules: [{ condition: "contain" }, {}]

kshipra

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 94
    • View Profile
I changed the columnTemplate to

 columnTemplate: { filter: { crules: [{ condition: "contain" }] } },

but still same error is happening as mentioned in previous post.

colModel: [{dataIndx: "Name", width: 200, filter: {crules: [{condition: "contain"}]}, hidden: false},…]
0: {dataIndx: "Name", width: 200, filter: {crules: [{condition: "contain"}]}, hidden: false}
1: {dataIndx: "Code", width: 100, filter: {crules: [{condition: "contain"}]}, hidden: false}
2: {dataIndx: "UMask", width: 100, filter: {crules: [{condition: "contain"}]}, hidden: false}
3: {dataIndx: "Unit", width: 100, filter: {crules: [{condition: "contain"}]}, hidden: false}
4: {dataIndx: "Counter", width: 100, filter: {crules: [{condition: "contain"}]}, hidden: false}
5: {dataIndx: "ArchEvent", width: 100, filter: {crules: [{condition: "contain"}]}, hidden: false}
6: {dataIndx: "SourceComponent", width: 100, filter: {crules: [{condition: "contain"}]}, hidden: false}
7: {dataIndx: "UsedIn", width: 100, filter: {crules: [{condition: "contain"}]}, hidden: false}
8: {dataIndx: "ExternalVisibility", width: 100, filter: {crules: [{condition: "contain"}]}, hidden: false}
9: {dataIndx: "BriefDescription", width: 200, filter: {crules: [{condition: "contain"}]}, hidden: false}
10: {dataIndx: "PublicDescription", width: 200, filter: {crules: [{condition: "contain"}]}, hidden: false}

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
I'm able to reproduce it, thanks for raising the issue.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
This is fixed in v5.6.1