Skip to content

Commit 258be4e

Browse files
committed
perf: Propagate silent flag to Component Column renderer to suppress scrolling updates (#8990)
1 parent 2892f7e commit 258be4e

2 files changed

Lines changed: 17 additions & 15 deletions

File tree

src/grid/Row.mjs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ class Row extends Component {
6060
* @param {Number} data.columnIndex
6161
* @param {Object} data.record
6262
* @param {Number} data.rowIndex
63+
* @param {Boolean} [data.silent]
6364
* @returns {Object}
6465
*/
65-
applyRendererOutput({cellId, column, columnIndex, record, rowIndex}) {
66+
applyRendererOutput({cellId, column, columnIndex, record, rowIndex, silent}) {
6667
let me = this,
6768
gridContainer = me.parent.parent, // Row -> Body -> GridContainer
6869
gridBody = me.parent,
@@ -98,6 +99,7 @@ class Row extends Component {
9899
record,
99100
row: me,
100101
rowIndex,
102+
silent,
101103
store,
102104
value: fieldValue
103105
});
@@ -191,18 +193,18 @@ class Row extends Component {
191193
* @param {Boolean} [silent=false]
192194
*/
193195
createVdom(silent=false) {
194-
let me = this,
195-
record = me.record,
196-
rowIndex = me.rowIndex,
197-
gridBody = me.parent, // The Row is an item of Body
198-
gridContainer = gridBody.parent,
199-
{columns} = gridContainer,
200-
{selectedRows} = gridBody,
201-
recordId = record[gridBody.store.getKeyProperty()],
202-
countColumns = columns.getCount(),
196+
let me = this,
197+
record = me.record,
198+
rowIndex = me.rowIndex,
199+
gridBody = me.parent, // The Row is an item of Body
200+
gridContainer = gridBody.parent,
201+
{columns} = gridContainer,
202+
{selectedRows} = gridBody,
203+
recordId = record[gridBody.store.getKeyProperty()],
204+
countColumns = columns.getCount(),
203205
{mountedColumns} = gridBody,
204-
cellConfig, column, columnPosition, i, isMounted,
205-
vdom = me.vdom;
206+
vdom = me.vdom,
207+
cellConfig, column, columnPosition, i, isMounted;
206208

207209
Object.assign(vdom, {
208210
'aria-rowindex': rowIndex + 2, // header row => 1, first body row => 2
@@ -245,7 +247,7 @@ class Row extends Component {
245247
continue
246248
}
247249

248-
cellConfig = me.applyRendererOutput({column, columnIndex: i, record, rowIndex});
250+
cellConfig = me.applyRendererOutput({column, columnIndex: i, record, rowIndex, silent});
249251

250252
if (column.dock) {
251253
cellConfig.cls = ['neo-locked', ...cellConfig.cls || []]

src/grid/column/Component.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Component extends Column {
7171
* @returns {*}
7272
*/
7373
cellRenderer(data) {
74-
let {component, gridContainer, record, row} = data,
74+
let {component, gridContainer, record, row, silent} = data,
7575
{appName, windowId} = gridContainer,
7676
me = this,
7777
{recordProperty} = me,
@@ -91,7 +91,7 @@ class Component extends Column {
9191

9292
componentConfig[recordProperty] = record;
9393

94-
component.set(componentConfig)
94+
component.set(componentConfig, silent)
9595
} else {
9696
component = Neo.create({
9797
...me.defaults,

0 commit comments

Comments
 (0)