Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable isSelected check performance improvement #4122

Closed
Ketec opened this issue Oct 6, 2017 · 1 comment
Closed

DataTable isSelected check performance improvement #4122

Ketec opened this issue Oct 6, 2017 · 1 comment
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@Ketec
Copy link

Ketec commented Oct 6, 2017

[ x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior

    isSelected(rowData) {
        if(rowData && this.selection) {
            if(this.dataKey) {

if this.selection is [], it does not return false. Empty array is still true. It may need a extra && this.selection.length > 0.
Expected behavior
It should properly return false if selection is empty. This may also affect performance because angular change detection calls this method for every row on every mouse click or even mouse move and it constantly triggers all the logic inside (a grid with a thousand rows could easily trigger it tens of thousands of times every second).

@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Oct 20, 2017
@cagataycivici cagataycivici added this to the 4.2.3 milestone Oct 20, 2017
@cagataycivici cagataycivici self-assigned this Oct 20, 2017
@cagataycivici cagataycivici changed the title Datatable isSelected not properly skipping empty array DataTable isSelected performance improvement Oct 24, 2017
@cagataycivici cagataycivici changed the title DataTable isSelected performance improvement DataTable isSelected check performance improvement Oct 24, 2017
@cagataycivici
Copy link
Member

This broke the table so reverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants