primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
9.91k stars 4.52k forks source link

Component: P-Table does work correctly with [rowTrackBy] for 17.13.0 version #15241

Closed Viktor-Ivliev closed 3 months ago

Viktor-Ivliev commented 3 months ago

Describe the bug

When use we "primeng": "17.13.0" and <p-table [rowTrackBy]="rowTrackBy" ....></p-table>

  rowTrackBy(_index, item) {
    return item.id;
  }

We have warning for develop and tests env: 'trackBy must be a function, but received null. See https://angular.io/api/common/NgForOf#change-propagation for more information.'

And it really doesn't use in p-table.

But when we use "primeng": "17.12.0" or less it works correctly

Environment

{
  "name": "frontend",
  "private": true,
  "dependencies": {
    "@angular/animations": "17.3.3",
    "@angular/cdk": "17.3.3",
    "@angular/common": "17.3.3",
    "@angular/compiler": "17.3.3",
    "@angular/core": "17.3.3",
    "@angular/forms": "17.3.3",
    "@angular/platform-browser": "17.3.3",
    "@angular/platform-browser-dynamic": "17.3.3",
    "@angular/router": "17.3.3",
    "@ctrl/ngx-emoji-mart": "9.2.0",
    "@ng-select/ng-select": "12.0.7",
    "@ngx-translate/core": "15.0.0",
    "@rails/actioncable": "7.0.8",
    "@rails/activestorage": "7.0.8",
    "@types/jquery": "3.5.29",
    "@typescript-plus/fast-memoize-decorator": "0.2.1",
    "angular-mentions": "1.5.0",
    "autolinker": "4.0.0",
    "bootstrap": "4.6.2",
    "chart.js": "4.4.2",
    "chartjs-plugin-datalabels": "2.2.0",
    "dayjs": "1.11.10",
    "deepmerge-ts": "5.1.0",
    "easymde": "2.18.0",
    "font-awesome": "4.7.0",
    "jquery": "3.7.1",
    "jspdf": "2.5.1",
    "jspdf-autotable": "3.8.2",
    "marked": "5.1.2",
    "marked-mangle": "1.1.0",
    "ng2-charts": "5.0.4",
    "ngx-cookie-service": "17.1.0",
    "ngx-translate-multi-http-loader": "17.0.0",
    "object-to-formdata": "4.5.1",
    "popper.js": "1.16.1",
    "postcss-preset-env": "9.5.4",
    "primeng": "17.13.0",
    "primeng-sass-theme": "https://github.com/primefaces/primeng-sass-theme",
    "rxjs": "7.8.1",
    "tippy.js": "6.3.7",
    "typescript": "5.4.4",
    "zone.js": "0.14.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "17.3.3",
    "@angular-eslint/builder": "17.3.0",
    "@angular-eslint/eslint-plugin": "17.3.0",
    "@angular-eslint/eslint-plugin-template": "17.3.0",
    "@angular-eslint/schematics": "17.3.0",
    "@angular-eslint/template-parser": "17.3.0",
    "@angular/cli": "17.3.3",
    "@angular/compiler-cli": "17.3.3",
    "@angular/language-service": "17.3.3",
    "@types/jasmine": "5.1.4",
    "@types/jasminewd2": "2.0.13",
    "@types/node": "20.12.6",
    "@typescript-eslint/eslint-plugin": "7.6.0",
    "@typescript-eslint/parser": "7.6.0",
    "eslint": "8.56.0",
    "eslint-plugin-import": "2.29.1",
    "eslint-plugin-jsdoc": "48.2.3",
    "eslint-plugin-prefer-arrow": "1.2.3",
    "eslint-plugin-unused-imports": "3.1.0",
    "jasmine-core": "5.1.2",
    "jasmine-spec-reporter": "7.0.0",
    "karma": "6.4.3",
    "karma-chrome-launcher": "3.2.0",
    "karma-coverage": "2.2.1",
    "karma-jasmine": "5.1.0",
    "karma-jasmine-html-reporter": "2.1.0",
    "ngx-translate-testing": "7.0.0",
    "postcss": "8.4.38",
    "protractor": "7.0.0",
    "ts-node": "10.9.2",
    "webdriver-manager": "12.1.9",
    "webpack-bundle-analyzer": "4.10.1"
  },
  "browserslist": "> 5%, last 3 Chrome versions, last 3 Firefox version, last 2 Edge major versions, last 4 Safari major versions, last 4 iOS major versions, Firefox ESR"
}

Reproducer

No response

Angular version

17.3.3

PrimeNG version

17.13.0

Build / Runtime

TypeScript

Language

TypeScript

Node version (for AoT issues node --version)

20.11.1

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

imaksp commented 3 months ago

This might be related: https://github.com/primefaces/primeng/pull/15243#issuecomment-2046148564

Viktor-Ivliev commented 3 months ago

This might be related: #15243 (comment)

Yes it looks similar, then it needs more fixes. Like remove this image https://github.com/primefaces/primeng/blob/711e5fbccd7f89574735c0a0bf4e4f2cbd6b1d17/src/app/components/table/table.ts

Viktor-Ivliev commented 3 months ago

Will be fixed here https://github.com/primefaces/primeng/pull/15248

BGBRWR commented 3 months ago

https://github.com/primefaces/primeng/pull/15243 fixes this.

Viktor-Ivliev commented 3 months ago

15243 fixes this.

tnx.

ok, I whait when they merged =)