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

Document multiTemplateDataRows #12793

Open
woteska opened this issue Aug 22, 2018 · 8 comments
Open

Document multiTemplateDataRows #12793

woteska opened this issue Aug 22, 2018 · 8 comments
Labels
area: docs Related to the documentation area: material/table P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@woteska
Copy link

woteska commented Aug 22, 2018

BUG

What is the expected behavior?

I can get the index of a row.

What is the current behavior?

Indexes are always undefined.

What are the steps to reproduce?

https://angular-material2-issue-xxupf5.stackblitz.io

What is the use-case or motivation for changing an existing behavior?

Highlighting a row ; Adding drag-and-drop feature to my project; etc.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

I only tried the latest Material.
OS: Win10
Others:

"dependencies": {
"@angular/animations": "^6.1.3",
"@angular/cdk": "^6.4.6",
"@angular/common": "^6.1.3",
"@angular/compiler": "^6.1.3",
"@angular/core": "^6.1.3",
"@angular/forms": "^6.1.3",
"@angular/http": "^6.1.3",
"@angular/material": "^6.4.6",
"@angular/platform-browser": "^6.1.3",
"@angular/platform-browser-dynamic": "^6.1.3",
"@angular/router": "^6.1.3",
"core-js": "^2.5.7",
"hammerjs": "^2.0.8",
"rxjs": "^6.2.2",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.7.4",
"@angular/cli": "~6.1.4",
"@angular/compiler-cli": "^6.1.3",
"@angular/language-service": "^6.1.3",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~10.7.1",
"codelyzer": "~4.4.4",
"jasmine-core": "~3.2.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^1.3.1",
"npm-upgrade": "^1.4.1",
"protractor": "~5.4.0",
"sort-package-json": "^1.15.0",
"ts-node": "~7.0.1",
"tslint": "~5.11.0",
"typescript": "~2.9.2"
}

Is there anything else we should know?

Angular Material Basic Table works perfectly: https://angular-z4wbnd.stackblitz.io

@geromegrignon
Copy link
Contributor

Change "let i = index" for "let i = dataIndex"
It works.

/**

  • Context provided to the row cells when multiTemplateDataRows is true. This context is the same
  • as CdkCellOutletRowContext except that the single index value is replaced by dataIndex and
  • renderIndex.
    */

source

@woteska
Copy link
Author

woteska commented Aug 23, 2018

@geromegrignon

Thanks buddy, it works!

I would suggest to complete the documentation (https://material.angular.io/components/table/api) with this very very important information if it is possible. It is missing of it and I found many users on forums who needs the index of the rows.

Apart from me issue can be closed. Thanks again!

@jelbourn jelbourn changed the title Material Table row-index always undefined Document multiTemplateDataRows Aug 24, 2018
@jelbourn jelbourn added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent docs This issue is related to documentation labels Aug 24, 2018
@mactechlabs
Copy link

Thanks Man. Works like a charm.

@bharath0
Copy link

Thank You Sir It is working

@ssarir
Copy link

ssarir commented Mar 15, 2020

@geromegrignon

Thanks buddy, it works!

I would suggest to complete the documentation (https://material.angular.io/components/table/api) with this very very important information if it is possible. It is missing of it and I found many users on forums who needs the index of the rows.

Apart from me issue can be closed. Thanks again!

Thanks it also saved my day

@Wilt
Copy link

Wilt commented May 20, 2020

Documentation still not updated?

@Akshar11
Copy link

Please update the documentation .

@richardwfff
Copy link

I agree it would be nice to have this information in the documentation since people can spend a lot of time debugging without knowing this is the property causing the problem and not having a way to search for the issue (me included)

@andrewseguin andrewseguin removed their assignment Jun 3, 2023
@mmalerba mmalerba added area: docs Related to the documentation and removed docs This issue is related to documentation labels Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docs Related to the documentation area: material/table P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests