@ag-grid-enterprise/server-side-row-model
Advanced tools
Comparing version 24.0.0 to 24.1.0
import { NumberSequence, RowBounds, RowNode, RowNodeBlock } from "@ag-grid-community/core"; | ||
import { ServerSideCache, ServerSideCacheParams } from "./serverSideCache"; | ||
export declare class ServerSideBlock extends RowNodeBlock { | ||
private rowRenderer; | ||
private columnController; | ||
@@ -6,0 +5,0 @@ private valueService; |
@@ -38,2 +38,3 @@ "use strict"; | ||
} | ||
// no need for @postConstruct, as attached to parent | ||
ServerSideBlock.prototype.init = function () { | ||
@@ -48,6 +49,3 @@ this.usingTreeData = this.gridOptionsWrapper.isTreeData(); | ||
this.createNodeIdPrefix(); | ||
_super.prototype.init.call(this, { | ||
context: this.getContext(), | ||
rowRenderer: this.rowRenderer | ||
}); | ||
_super.prototype.init.call(this); | ||
}; | ||
@@ -438,5 +436,2 @@ ServerSideBlock.prototype.setBeans = function (loggerFactory) { | ||
__decorate([ | ||
core_1.Autowired('rowRenderer') | ||
], ServerSideBlock.prototype, "rowRenderer", void 0); | ||
__decorate([ | ||
core_1.Autowired('columnController') | ||
@@ -457,5 +452,2 @@ ], ServerSideBlock.prototype, "columnController", void 0); | ||
__decorate([ | ||
core_1.PostConstruct | ||
], ServerSideBlock.prototype, "init", null); | ||
__decorate([ | ||
__param(0, core_1.Qualifier('loggerFactory')) | ||
@@ -462,0 +454,0 @@ ], ServerSideBlock.prototype, "setBeans", null); |
@@ -1,2 +0,2 @@ | ||
import { ColumnVO, IServerSideCache, IServerSideDatasource, NumberSequence, RowBounds, RowNode, RowNodeCacheParams, RowNodeCache } from "@ag-grid-community/core"; | ||
import { ColumnVO, IServerSideCache, IServerSideDatasource, NumberSequence, RowBounds, RowNode, RowNodeCacheParams, RowNodeCache, RowDataTransaction, RowNodeTransaction } from "@ag-grid-community/core"; | ||
import { ServerSideBlock } from "./serverSideBlock"; | ||
@@ -33,2 +33,3 @@ export interface ServerSideCacheParams extends RowNodeCacheParams { | ||
isDisplayIndexInCache(displayIndex: number): boolean; | ||
applyTransaction(rowDataTransaction: RowDataTransaction): RowNodeTransaction | null; | ||
getChildCache(keys: string[]): ServerSideCache | null; | ||
@@ -35,0 +36,0 @@ isPixelInRange(pixel: number): boolean; |
@@ -325,2 +325,17 @@ "use strict"; | ||
}; | ||
ServerSideCache.prototype.applyTransaction = function (rowDataTransaction) { | ||
// if (this.isMaxRowFound() || this.getBlock()) { | ||
// return null; | ||
// } | ||
var res = { | ||
add: [], | ||
remove: [], | ||
update: [] | ||
}; | ||
if (rowDataTransaction.add) { | ||
rowDataTransaction.add.forEach(function (item) { | ||
}); | ||
} | ||
return res; | ||
}; | ||
ServerSideCache.prototype.getChildCache = function (keys) { | ||
@@ -327,0 +342,0 @@ var _this = this; |
@@ -1,2 +0,2 @@ | ||
import { BeanStub, IServerSideDatasource, IServerSideRowModel, RowBounds, RowNode } from "@ag-grid-community/core"; | ||
import { BeanStub, IServerSideDatasource, IServerSideRowModel, RowBounds, RowNode, RowDataTransaction } from "@ag-grid-community/core"; | ||
export declare class ServerSideRowModel extends BeanStub implements IServerSideRowModel { | ||
@@ -21,2 +21,3 @@ private gridOptionsWrapper; | ||
private setBeans; | ||
applyTransaction(rowDataTransaction: RowDataTransaction, route: string[]): void; | ||
private addEventListeners; | ||
@@ -23,0 +24,0 @@ setDatasource(datasource: IServerSideDatasource): void; |
@@ -58,2 +58,7 @@ "use strict"; | ||
}; | ||
ServerSideRowModel.prototype.applyTransaction = function (rowDataTransaction, route) { | ||
this.executeOnCache(route, function (cache) { | ||
cache.applyTransaction(rowDataTransaction); | ||
}); | ||
}; | ||
ServerSideRowModel.prototype.addEventListeners = function () { | ||
@@ -275,2 +280,10 @@ this.addManagedListener(this.eventService, core_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.onColumnRowGroupChanged.bind(this)); | ||
} | ||
var userProvidedBlockSize = this.gridOptionsWrapper.getCacheBlockSize(); | ||
var blockSize; | ||
if (typeof userProvidedBlockSize == 'number' && userProvidedBlockSize > 0) { | ||
blockSize = userProvidedBlockSize; | ||
} | ||
else { | ||
blockSize = serverSideBlock_1.ServerSideBlock.DefaultBlockSize; | ||
} | ||
var params = { | ||
@@ -290,26 +303,7 @@ // the columns the user has grouped and aggregated by | ||
initialRowCount: 1, | ||
maxConcurrentRequests: this.gridOptionsWrapper.getMaxConcurrentDatasourceRequests() || 0, | ||
maxBlocksInCache: maxBlocksInCache, | ||
blockSize: this.gridOptionsWrapper.getCacheBlockSize(), | ||
blockSize: blockSize, | ||
rowHeight: this.rowHeight, | ||
dynamicRowHeight: dynamicRowHeight | ||
}; | ||
// set defaults | ||
if (!(params.maxConcurrentRequests >= 1)) { | ||
params.maxConcurrentRequests = 2; | ||
} | ||
// page size needs to be 1 or greater. having it at 1 would be silly, as you would be hitting the | ||
// server for one page at a time. so the default if not specified is 100. | ||
if (!(params.blockSize >= 1)) { | ||
params.blockSize = serverSideBlock_1.ServerSideBlock.DefaultBlockSize; | ||
} | ||
// if user doesn't give initial rows to display, we assume zero | ||
if (!(params.initialRowCount >= 1)) { | ||
params.initialRowCount = 0; | ||
} | ||
// if user doesn't provide overflow, we use default overflow of 1, so user can scroll past | ||
// the current page and request first row of next page | ||
if (!(params.overflowSize >= 1)) { | ||
params.overflowSize = 1; | ||
} | ||
return params; | ||
@@ -316,0 +310,0 @@ }; |
import { NumberSequence, RowBounds, RowNode, RowNodeBlock } from "@ag-grid-community/core"; | ||
import { ServerSideCache, ServerSideCacheParams } from "./serverSideCache"; | ||
export declare class ServerSideBlock extends RowNodeBlock { | ||
private rowRenderer; | ||
private columnController; | ||
@@ -6,0 +5,0 @@ private valueService; |
@@ -23,3 +23,3 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
import { Autowired, PostConstruct, Qualifier, RowNodeBlock, _ } from "@ag-grid-community/core"; | ||
import { Autowired, Qualifier, RowNodeBlock, _ } from "@ag-grid-community/core"; | ||
var ServerSideBlock = /** @class */ (function (_super) { | ||
@@ -37,2 +37,3 @@ __extends(ServerSideBlock, _super); | ||
} | ||
// no need for @postConstruct, as attached to parent | ||
ServerSideBlock.prototype.init = function () { | ||
@@ -47,6 +48,3 @@ this.usingTreeData = this.gridOptionsWrapper.isTreeData(); | ||
this.createNodeIdPrefix(); | ||
_super.prototype.init.call(this, { | ||
context: this.getContext(), | ||
rowRenderer: this.rowRenderer | ||
}); | ||
_super.prototype.init.call(this); | ||
}; | ||
@@ -437,5 +435,2 @@ ServerSideBlock.prototype.setBeans = function (loggerFactory) { | ||
__decorate([ | ||
Autowired('rowRenderer') | ||
], ServerSideBlock.prototype, "rowRenderer", void 0); | ||
__decorate([ | ||
Autowired('columnController') | ||
@@ -456,5 +451,2 @@ ], ServerSideBlock.prototype, "columnController", void 0); | ||
__decorate([ | ||
PostConstruct | ||
], ServerSideBlock.prototype, "init", null); | ||
__decorate([ | ||
__param(0, Qualifier('loggerFactory')) | ||
@@ -461,0 +453,0 @@ ], ServerSideBlock.prototype, "setBeans", null); |
@@ -1,2 +0,2 @@ | ||
import { ColumnVO, IServerSideCache, IServerSideDatasource, NumberSequence, RowBounds, RowNode, RowNodeCacheParams, RowNodeCache } from "@ag-grid-community/core"; | ||
import { ColumnVO, IServerSideCache, IServerSideDatasource, NumberSequence, RowBounds, RowNode, RowNodeCacheParams, RowNodeCache, RowDataTransaction, RowNodeTransaction } from "@ag-grid-community/core"; | ||
import { ServerSideBlock } from "./serverSideBlock"; | ||
@@ -33,2 +33,3 @@ export interface ServerSideCacheParams extends RowNodeCacheParams { | ||
isDisplayIndexInCache(displayIndex: number): boolean; | ||
applyTransaction(rowDataTransaction: RowDataTransaction): RowNodeTransaction | null; | ||
getChildCache(keys: string[]): ServerSideCache | null; | ||
@@ -35,0 +36,0 @@ isPixelInRange(pixel: number): boolean; |
@@ -323,2 +323,17 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
ServerSideCache.prototype.applyTransaction = function (rowDataTransaction) { | ||
// if (this.isMaxRowFound() || this.getBlock()) { | ||
// return null; | ||
// } | ||
var res = { | ||
add: [], | ||
remove: [], | ||
update: [] | ||
}; | ||
if (rowDataTransaction.add) { | ||
rowDataTransaction.add.forEach(function (item) { | ||
}); | ||
} | ||
return res; | ||
}; | ||
ServerSideCache.prototype.getChildCache = function (keys) { | ||
@@ -325,0 +340,0 @@ var _this = this; |
@@ -1,2 +0,2 @@ | ||
import { BeanStub, IServerSideDatasource, IServerSideRowModel, RowBounds, RowNode } from "@ag-grid-community/core"; | ||
import { BeanStub, IServerSideDatasource, IServerSideRowModel, RowBounds, RowNode, RowDataTransaction } from "@ag-grid-community/core"; | ||
export declare class ServerSideRowModel extends BeanStub implements IServerSideRowModel { | ||
@@ -21,2 +21,3 @@ private gridOptionsWrapper; | ||
private setBeans; | ||
applyTransaction(rowDataTransaction: RowDataTransaction, route: string[]): void; | ||
private addEventListeners; | ||
@@ -23,0 +24,0 @@ setDatasource(datasource: IServerSideDatasource): void; |
@@ -56,2 +56,7 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
ServerSideRowModel.prototype.applyTransaction = function (rowDataTransaction, route) { | ||
this.executeOnCache(route, function (cache) { | ||
cache.applyTransaction(rowDataTransaction); | ||
}); | ||
}; | ||
ServerSideRowModel.prototype.addEventListeners = function () { | ||
@@ -273,2 +278,10 @@ this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.onColumnRowGroupChanged.bind(this)); | ||
} | ||
var userProvidedBlockSize = this.gridOptionsWrapper.getCacheBlockSize(); | ||
var blockSize; | ||
if (typeof userProvidedBlockSize == 'number' && userProvidedBlockSize > 0) { | ||
blockSize = userProvidedBlockSize; | ||
} | ||
else { | ||
blockSize = ServerSideBlock.DefaultBlockSize; | ||
} | ||
var params = { | ||
@@ -288,26 +301,7 @@ // the columns the user has grouped and aggregated by | ||
initialRowCount: 1, | ||
maxConcurrentRequests: this.gridOptionsWrapper.getMaxConcurrentDatasourceRequests() || 0, | ||
maxBlocksInCache: maxBlocksInCache, | ||
blockSize: this.gridOptionsWrapper.getCacheBlockSize(), | ||
blockSize: blockSize, | ||
rowHeight: this.rowHeight, | ||
dynamicRowHeight: dynamicRowHeight | ||
}; | ||
// set defaults | ||
if (!(params.maxConcurrentRequests >= 1)) { | ||
params.maxConcurrentRequests = 2; | ||
} | ||
// page size needs to be 1 or greater. having it at 1 would be silly, as you would be hitting the | ||
// server for one page at a time. so the default if not specified is 100. | ||
if (!(params.blockSize >= 1)) { | ||
params.blockSize = ServerSideBlock.DefaultBlockSize; | ||
} | ||
// if user doesn't give initial rows to display, we assume zero | ||
if (!(params.initialRowCount >= 1)) { | ||
params.initialRowCount = 0; | ||
} | ||
// if user doesn't provide overflow, we use default overflow of 1, so user can scroll past | ||
// the current page and request first row of next page | ||
if (!(params.overflowSize >= 1)) { | ||
params.overflowSize = 1; | ||
} | ||
return params; | ||
@@ -314,0 +308,0 @@ }; |
{ | ||
"name": "@ag-grid-enterprise/server-side-row-model", | ||
"version": "24.0.0", | ||
"version": "24.1.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components", | ||
@@ -45,4 +45,4 @@ "main": "./dist/cjs/main.js", | ||
"dependencies": { | ||
"@ag-grid-community/core": "~24.0.0", | ||
"@ag-grid-enterprise/core": "~24.0.0" | ||
"@ag-grid-community/core": "~24.1.0", | ||
"@ag-grid-enterprise/core": "~24.1.0" | ||
}, | ||
@@ -49,0 +49,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
5987424
40
95934
+ Added@ag-grid-community/core@24.1.0(transitive)
+ Added@ag-grid-enterprise/core@24.1.0(transitive)
- Removed@ag-grid-community/core@24.0.0(transitive)
- Removed@ag-grid-enterprise/core@24.0.0(transitive)