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 - [email protected]

Pages: [1]
1
Bug Report / Re: Group Sort not restored after multi-column sort is cleared
« on: September 08, 2022, 05:40:10 am »
I tested the 8.6.0 version and the original sort order is returned after performing this test with nested JSON data. Thanks for the fix!

2
Bug Report / Re: Sorting of grouped data using non-group by column confusing
« on: September 07, 2022, 03:10:33 am »
I tested the 8.6.0 version and the summary data is now being calculated correctly and sorting is correct for nested JSON data. Thanks for the fix!

3
Bug Report / Group Sort not restored after multi-column sort is cleared
« on: August 18, 2022, 05:24:16 am »
I am currently using Pro version 8.5.0.

I have found an issue with group sorting not being restored to the original sort order after a multi-column sort is cleared.

I created a JSFiddle to demonstrate the issue using the following steps. https://jsfiddle.net/jhschmidt/bc8hmwo1/
  • Run the JSFiddle demo
  • Note that the order of the 'Name' column groups and the 'Position' column values are sorted because they are ordered in the JSON data
  • Click the 'Letters' column header to sort by the letters column summary which is 'min'
  • Observe that the rows are sorted correctly and the group order is now B, D, A, C, E
  • Click the 'Digits' column header to sort the digits column summary which is 'min'
  • Observe that the rows are sorted correctly and the group order is still B, D, A, C, E
  • Click the 'Digits' column header two more times to remove the sort
  • Observe that the rows did not return to the original letters sort order
  • Click the 'Letters' column header two more times to remove the sort
  • Observe that the rows did not return to the original sort order of the name groups and position values
Note: When the group is removed this sorting test works correctly.

I did some debugging and found that after Step 9. the internal pq_order sort is applied which the onCustomSortTree function uses. The group title rows do not have a pq_order property so the groups do not sort.

I hope this helps you track down this issue.

Thanks,
Jim

4
I did some debugging and found that the rowTemplate accessors are added to the row data in cRefresh.addRowIndx() which occurs after the row data is summarized by the call to self.groupData() in onDataReady on line 15996. The row data is extended in cRefresh.addRowIndx() by a call to pq.extendT() which on line 1189 tests for an undefined property. Unfortunately the property has already been assigned a value when the summary is created so the accessor to the nested JSON data is not assigned.

I hope this helps,
Jim

Code: [Select]
onDataReady: function() {
var self = this,
that = self.that,
GM = that.options.groupModel,
GMLen = GM.dataIndx.length;
if (GM.on) {
if (GMLen || GM.grandSummary) {
if (that._trigger("isSkipGroup") !== false) {
self.groupData();
self.buildCache()
}
that.iRefresh.addRowIndx();
self.refreshColumns();
if (GMLen) {
self.initcollapsed();
self.initmerge();
if (self.isCascade(GM)) {
self.cascadeInit()
}
}
} else {
self.refreshColumns()
}
self.setValCBox()
}
self.createHeader()
},

5
I waited for the 8.5.0 release before revisiting this issue. I am still having problems with sorting columns that display nested JSON even when there is a summary defined for the column. During my testing I also found that the nested JSON columns are not summarized properly.
  • When the colModel contains a groupModel with a group column the summaries are not calculated.
  • When the summaries are not calculated the column sorts as if there were no summary so the data is sorted within the group unless Ctrl-Click is used for sorting.
I created this JSFiddle so you can see what is happening: https://jsfiddle.net/jhschmidt/rLbcn4ws/2/
  • Try closing the company group. Observe that the Revenues and Profits summaries are Sum: $0.00
  • Try opening the company group and sort by Revenue. Observe that the Revenues only sort within the group as if there were no summary.
While testing with the JSFiddle I discovered that the issue is caused by the group column being defined in the colModel. If the groupModel does not contain a column and the column is added after initialization the summaries are calculated correctly and sorting works as expected.

I hope this helps with this issue.

Thanks,
Jim

6
That is an interesting feature.

My date2 column is a summary column of nested JSON data so it gets its data from a a row template getter. Could that be affecting the behavior?

When I use the Ctrl-click on the header it does sort the groups also but when I Ctrl-click until the sort is removed the group sort does not return to its initial state.

Thanks for your help,

Jim

7
I am currently using version 8.3.0.

I have a grid with one grouped column and two date columns. When I click the header for date1 all of the data is sorted including the grouped column. When I click the header of date2 the data is only sorted within each group.

I checked your Grouped Rows demo https://www.paramquery.com/pro/demos/export and found the same behavior. When the "Freight" column header is clicked the "ShipCountry" column row order changes but when "Shipping Via", "Shipped Date" or "Shipping City" headers are clicked the "ShipCountry" retains its alphabetical sorting and the sorted column data is sorted with its group.

I checked the demo code and didn't find special sort configurations to cause this behavior. What is causing this difference in sort behavior?

I would like to configure my grid to behave like the "Freight" column unless the group by column has been sorted by the user.

Thanks for your help!

8
If it will be a long time before it is fixed in a release and you have a patch I will use it. Otherwise I will temporarily fix it myself.

Thanks,
Jim

9
I am currently using version 8.3.0.

I am using the max function for a column that is dataType: 'date' and a groupModel that results in some groups with a single row. In those groups the max date is not displayed in the group summary for that group.

I investigated and found that the max function initializes the max variable using the arr[0] element. It then compares that in the while loop with valDate which in this case is also the arr[0] element value. Because valDate is not greater than max the val variable remains undefined. The max variable is assigned the val value after the while loop exits so the returned max value is undefined.

Note: max would also probably be undefined in a multi-row group when the arr[0] element happens to be the maximum date.

The code for the max function starts on line 14928 in pqgrid.dev.js and is shown below:

Code: [Select]
max: function(arr, column) {
var len, max, temp, val, valDate, dataType = pq.getDataType(column);
arr = this.flatten(arr);
len = arr.length;
if (len) {
if (dataType == "number") {
max = arr[0] * 1;
while (len--) {
temp = arr[len];
max = temp > max || isNaN(max) ? temp : max
}
} else if (dataType == "date") {
max = Date.parse(arr[0]);
while (len--) {
valDate = Date.parse(arr[len]);
if (valDate > max || isNaN(max)) {
max = valDate;
val = arr[len]
}
}
max = val
} else {
arr.sort();
max = arr[len - 1]
}
return max
}
},

10
Using 99% will work fine for me as a workaround.

Thanks for the quick reply!

11
I created a JSFiddle that demonstrates the issue.

Repro Steps:
  • Go to https://jsfiddle.net/jhschmidt/o30c92zd/33/
  • Observe that the grid view and its vertical scrollbar are fully visible
  • Drag the bottom of the CSS pane up to enlarge the grid view
  • Observe that the grid view and its vertical scrollbar resize properly and are fully visible
  • Drag the bottom of the CSS pane down to shrink the grid view
  • Observe that the grid view and its vertical scrollbar do not resize and are not fully visible

Thanks for your help,
Jim

12
I am currently using version 8.0.1.

I have defined the dimsRelativeTo property for my grid. This works well in most cases but when the browser window is resized by dragging the window edges the parent dimensions returned by the cRefresh.getParentDims function are those of the direct parent not the parent defined in dimsRelativeTo. In my case this causes the grid to be sized outside of the dimsRelativeTo parent bounds.

The code calling getParentDims is line 8059 in pqgrid.dev.js and is shown below:

Code: [Select]
            if (isReactiveDims) self.setResizeTimer(function() {
                arr = self.getParentDims(), newWdParent = arr[0], newHtParent = arr[1];
                if (newHtParent == htParent && newWdParent == wdParent) {
                    if (parseInt($grid.width()) == parseInt(dims.wdGrid)) {
                        return
                    }
                } else {
                    dims.htParent = newHtParent;
                    dims.wdParent = newWdParent
                }
                self.refresh({
                    soft: true
                })

Pages: [1]