Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7cd7fd1
Add the correct value to serverPaging
KBazGenexus Mar 8, 2024
d7fbe67
Add the correct value to paging property
KBazGenexus Mar 8, 2024
e32e6d0
Add the correct value for ServerPagingPivot property
KBazGenexus Mar 8, 2024
eb5b534
Update jspivottable version from 1.1.8 to 1.1.9
KBazGenexus Mar 8, 2024
fc790f9
Assign the correct value of PageSize property
KBazGenexus Mar 12, 2024
525d9bf
Remove client-side pagination
KBazGenexus Mar 12, 2024
1a31370
Merge branch 'main' into fix/table-output
KBazGenexus Mar 12, 2024
00d0e19
Add some clarifications on how the implementation works.
KBazGenexus Mar 13, 2024
4be5b0d
Add some clarifications on how the implementation works.
KBazGenexus Mar 13, 2024
e1da4bf
Extend condition for both PivotTable and Table types
KBazGenexus Mar 13, 2024
09d40b3
Correct the capitalization in the PageSize property
KBazGenexus Mar 13, 2024
5acf1ef
Merge branch 'fix/table-output' of https://github.com/genexuslabs/rep…
KBazGenexus Mar 13, 2024
c5c25ea
Merge branch 'main' into fix/table-output
KBazGenexus Mar 13, 2024
ce9290a
Assign the correct value to PageSize property
KBazGenexus Mar 13, 2024
938e366
Merge branch 'fix/table-output' of https://github.com/genexuslabs/rep…
KBazGenexus Mar 13, 2024
648f4da
Fix to avoid the duplicate request for pageData and the unnecesary re…
KBazGenexus Mar 13, 2024
f3c5f05
Update components.d.ts
KBazGenexus Mar 13, 2024
dfc5570
Update readme.md
KBazGenexus Mar 13, 2024
f0381dc
Add QueryViewerId value for the requestInitialPageDataForTable
KBazGenexus Mar 13, 2024
081d2ac
Fixes for PageSize and Paging properties
KBazGenexus Mar 13, 2024
7ab52d0
Bump @genexus/reporting-api from 2.3.6 to 2.3.7
KBazGenexus Mar 13, 2024
2538563
Update readme.md
KBazGenexus Mar 13, 2024
b06100c
Update components.d.ts
KBazGenexus Mar 13, 2024
780df15
Remove unnecessary Watch and variable
KBazGenexus Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
},
"license": "MIT",
"dependencies": {
"@genexus/reporting-api": "~2.3.6",
"@genexus/reporting-api": "~2.3.7",
"@genexus/web-controls-library": "2.3.0",
"date-fns": "^2.30.0",
"highcharts": "^11.1.0",
"jquery": "^3.7.1",
"jspivottable": "1.1.8",
"jspivottable": "1.1.9",
"material-icons": "^1.13.1",
"rollup-plugin-dotenv": "^0.5.0"
}
Expand Down
4 changes: 2 additions & 2 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,11 @@ export namespace Components {
/**
* PivotTable's Method for PivotTable Page Data
*/
"getPageDataForPivotTable": (properties: QueryViewerPageDataForPivot, paging: boolean, totalForColumns: QueryViewerTotal, totalForRows: QueryViewerTotal) => Promise<void>;
"getPageDataForPivotTable": (pageData: QueryViewerPageDataForPivot) => Promise<void>;
/**
* Table's Method for Table Page Data
*/
"getPageDataForTable": (properties: QueryViewerPageDataForTable, paging: boolean, totalForColumns: QueryViewerTotal, totalForRows: QueryViewerTotal) => Promise<void>;
"getPageDataForTable": (pageData: QueryViewerPageDataForTable) => Promise<void>;
/**
* PivotTable's Method for PivotTable Data Sync Response
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export class QueryViewerPivotTableRender {
RealType: QueryViewerOutputType.PivotTable,
ObjectName: this.serviceResponse.objectName,
ControlName: this.controlName,
PageSize: this.paging === true ? this.pageSize : undefined,
PageSize: this.pageSize,
metadata: this.serviceResponse.metadataXML,
UcId: this.controlName,
// ToDo: check if this property make sense with the AutoGrow implementation in the SD programming model
Expand All @@ -231,10 +231,11 @@ export class QueryViewerPivotTableRender {
UseRecordsetCache: !this.serviceResponse.useGxQuery,
AllowSelection: this.allowSelection,
SelectLine: true,
// ToDo: update this value
// PivotTable and Table outputs always have ServerPaging enabled, because client-side paging is no
// longer supported. If in GeneXus Paging = false, we should send the PageSize property with undefined
// so that the PivotTable and the Table know that pagination is not configured.
ServerPaging: true,
// ToDo: update this value
ServerPagingPivot: this.paging,
ServerPagingPivot: true,
// ToDo: update this value
ServerPagingCacheSize: 0,
TotalForColumns: this.totalForColumns,
Expand All @@ -247,7 +248,7 @@ export class QueryViewerPivotTableRender {
RealType: QueryViewerOutputType.Table,
ObjectName: this.serviceResponse.objectName,
ControlName: this.controlName,
PageSize: this.paging === true ? this.pageSize : undefined,
PageSize: this.paging ? this.pageSize : undefined,
metadata: this.serviceResponse.metadataXML,
UcId: this.controlName,
// ToDo: check if this property make sense with the AutoGrow implementation in the SD programming model
Expand All @@ -258,10 +259,11 @@ export class QueryViewerPivotTableRender {
UseRecordsetCache: !this.serviceResponse.useGxQuery,
AllowSelection: this.allowSelection,
SelectLine: true,
// ToDo: update this value
// PivotTable and Table outputs always have ServerPaging enabled, because client-side paging is no
// longer supported. If in GeneXus Paging = false, we should send the PageSize property with undefined
// so that the PivotTable and the Table know that pagination is not configured.
ServerPaging: true,
// ToDo: update this value
ServerPagingPivot: this.paging,
ServerPagingPivot: true,
// ToDo: update this value
ServerPagingCacheSize: 0,
TotalForColumns: this.totalForColumns,
Expand Down Expand Up @@ -307,24 +309,6 @@ export class QueryViewerPivotTableRender {
if (!previousStateSave || !this.rememberLayout) {
this.requestInitialPageDataForTable();
}
} else if (!this.paging) {
this.mustWaitInitialPageDataForTable = false;
// Paginado en el cliente
// qv.services.GetDataIfNeeded(qViewer, function (resText, qViewer) {
// // Servicio GetData
// if (resText != qViewer.xml.data) {
// qViewer.xml.data = resText;
// }
// const d3 = new Date();
// const t3 = d3.getTime();
// if (!qv.util.anyError(resText)) {
// renderPivotTable(qViewer);
// } else {
// // Error en el servicio GetData
// errMsg = qv.util.getErrorFromText(resText);
// qv.util.renderError(qViewer, errMsg);
// }
// });
} else {
this.mustWaitInitialPageDataForTable = false;
}
Expand Down Expand Up @@ -375,17 +359,15 @@ export class QueryViewerPivotTableRender {

private requestInitialPageDataForTable() {
const dataFieldAndOrder = this.getDataFieldAndOrder();

const pageDataTableParameters = {
PageNumber: 1,
PageSize: this.pageSize,
PageSize: this.paging ? this.pageSize : undefined,
RecalculateCantPages: true,
DataFieldOrder: dataFieldAndOrder.dataFieldOrder,
OrderType: dataFieldAndOrder.orderType,
Filters: [],
LayoutChange: false,
// ToDo: get the proper QueryViewerId
QueryviewerId: ""
QueryviewerId: this.controlName
};
const requestPageDataEvent = new CustomEvent("RequestPageDataForTable", {
bubbles: true
Expand Down
31 changes: 25 additions & 6 deletions src/components/query-viewer-pivot-table/query-viewer-pivot.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
import { Component, h, Method, Prop, Watch } from "@stencil/core";
import { Component, h, Method, Prop, Watch, Listen } from "@stencil/core";
import {
renderJSPivot,
OAT,
Expand All @@ -23,7 +23,9 @@ import {
QueryViewerPivotParameters,
QueryViewerPivotTable,
QueryViewerShowDataLabelsIn,
QueryViewerTotal
QueryViewerTotal,
QueryViewerPageDataForTable,
QueryViewerPageDataForPivot
} from "@genexus/reporting-api";

const PIVOT_PAGE = (ucId: string) => `${ucId}_GeneralQuery1_pivot_page`;
Expand All @@ -37,6 +39,7 @@ export class QueryViewerPivot {
private queryViewerContainer: HTMLDivElement;
private queryViewerConfiguration: QueryViewerPivotTable = undefined;
private shouldReRenderPivot = false;
private pageSizeChangeWasCommittedByTheUser = false;

/**
* Response Attribute Values
Expand Down Expand Up @@ -197,6 +200,10 @@ export class QueryViewerPivot {
@Prop() readonly pageSize: number;
@Watch("pageSize")
pageSizeInChange() {
if (this.pageSizeChangeWasCommittedByTheUser) {
this.pageSizeChangeWasCommittedByTheUser = false;
return;
}
this.shouldReRenderPivot = true;
}

Expand Down Expand Up @@ -266,6 +273,18 @@ export class QueryViewerPivot {
GXPL_QViewerJSMoveColumnToRight: "to right"
};

@Listen("RequestPageDataForPivotTable", {
target: "document",
capture: true
})
@Listen("RequestPageDataForTable", { target: "document", capture: true })
handleRequestPageDataForTable(event) {
const pageData: QueryViewerPageDataForTable | QueryViewerPageDataForPivot =
(event as any).parameter;
this.pageSizeChangeWasCommittedByTheUser =
this.pageSize !== pageData.PageSize;
}

/**
* Returns an XML on a string variable containing all the data for the attributes loaded in the Pivot Table.
*/
Expand Down Expand Up @@ -330,14 +349,14 @@ export class QueryViewerPivot {
ObjectName: this.objectName,
ControlName: this.pivotParameters.ControlName,
metadata: this.metadata,
PageSize: this.pageSize,
PageSize: this.paging ? this.pageSize : undefined,
UcId: this.pivotParameters.UcId,
AutoResize: this.autoResize,
DisableColumnSort: false,
RememberLayout: this.rememberLayout,
ShowDataLabelsIn: this.showDataLabelsIn,
ServerPaging: true,
ServerPagingPivot: this.paging,
ServerPaging: true, // PivotTable and Table outputs always have ServerPaging enabled, because client-side paging is no longer supported. If in GeneXus Paging = false, we should send the PageSize property with undefined so that the PivotTable and the Table know that pagination is not configured.
ServerPagingPivot: true,
ServerPagingCacheSize: 0,
UseRecordsetCache: true,
AllowSelection: false,
Expand Down Expand Up @@ -377,7 +396,7 @@ export class QueryViewerPivot {
return (
<div
class="gx-query-viewer-pivot-container"
id="gx_query_viewer_pivot_container"
id={this.pivotParameters.UcId}
ref={el => (this.queryViewerContainer = el)}
>
<div
Expand Down
Loading