Skip to content

Commit 8ea3c1f

Browse files
Performance (datatable): limiting re-render for only radiobutton/checkbox cells at row selection (primefaces#7425)
* Improved performance of DataTable by adding conditions for when the BodyCell should re-render. * Created selectiveCompare function to assist components' memoization * Simplified BodyCell props parsing in BodyRow.js * Calculation of selected state for BodyCell being done in the BodyRow now. * Fixed performance issue of Datatable related to cell/row selection, by avoiding unnecessary re-render of cells. CAREFUL: some bugs detected related to MetaKey which are still not yet fixed. * Further performance improvements to BodyRow.js * Fixed bug related to the MetaKeySelection in TableBody.js * Bug fixing in BodyRow.js * Shifted functions helper functions selectiveCompare, absoluteCompare and getNestedValue from BodyCell.js to ObjectUtils and ran prettier to avoid pull request errors * Shifted several functions from BodyCell.js to BodyRow.js so that they are only created once. Wrapped several of them in useCallback. * Logging msg * Shifted column props calculation to TableBody since it is an expensive operation * Renamed the BodyCell to Cell and split it in two parts: BodyCell and a RadioCheckCell. The latter is used for the checkbox and radio buttons. This is to avoid re-rendering all cells when a row is selected. Now, only the RadioCheckCell is re-rendered. * Removed console.log in DataTable.js * Ran prettier in changed files * Fixed minor bug in createLoading and lint error by unwrapping functions of BodyCell.js from usecallback - they would get re-created anyway since they depend on functions. * Minor bug fixing in absoluteCompare util function * Removed redudant memoization of Cell * Added key to Cell at mapping * Run prettier * Bug fixing related to columns which get dynamically frozen * Bug fixing related to columns which get dynamically frozen * Bug fixing related to columns which get dynamically frozen --------- Co-authored-by: Melloware <[email protected]>
1 parent dc0160c commit 8ea3c1f

File tree

4 files changed

+819
-773
lines changed

4 files changed

+819
-773
lines changed

0 commit comments

Comments
 (0)