Coder Social home page Coder Social logo

Comments (5)

daniel-nagy avatar daniel-nagy commented on July 30, 2024

Does your table have multiple header rows? This module is not designed for tables with multiple header rows and I think I would advise against it. It might be confusing for a user to see a table with multiple header rows and I'm not sure what meaning that would have.

Anyways, I just tried this in the demo app and using ng-repeat on a table header row resulted in each header row getting a master checkbox but row selection still worked. I don't see anything else that would break row selection.

For me to help you further I would need to see a plunker, code pen, etc. that clearly demonstrates the issue.

from md-data-table.

orbatschow avatar orbatschow commented on July 30, 2024

No i dont have multiple header rows, my markup looks like this right now:

<md-data-table-container> <table md-data-table md-row-select="selected"> <thead md-order="query.order"> <tr data-ng-repeat="selection in config.configs"> <th order-by="name" data-ng-repeat="entry in selection">{{entry.attributeName}}</th> </tr> </thead> <tbody md-auto-select> <tr data-ng-repeat="selection in config.configs | orderBy: query.order | filter: skip | limitTo: query.limit"> <td data-ng-repeat="entry in selection">{{entry.valueName}}</td> </tr> </tbody> </table> </md-data-table-container>

while configs looks like this:

[ { "productId":175, "productName":"test", "configs":[ [ { "attributeId":"176", "attributeName":"Durchmesser", "valueId":180, "valueName":"25cm" }, { "attributeId":"177", "attributeName":"Lichtstärke", "valueId":181, "valueName":"50l" }, { "attributeId":"178", "attributeName":"Radius", "valueId":183, "valueName":"10cm" }, { "attributeId":"179", "attributeName":"Preis", "valueId":182, "valueName":"300€" } ] ] } ]

I loop over the configs array and create a new table for each entry.

github-data-table-issue

from md-data-table.

daniel-nagy avatar daniel-nagy commented on July 30, 2024

In your thead element, you are using ng-repeat on the tr element. This could potentially produce multiple header rows if you had more that one object in your configs array. I might suggest reconsidering the format of your object or to not use ng-repeat to access the first object in an array.

I've created a fork-able Codepen under the Demo section in the README. Please use this to reproduce the issue and I will try to fix it for you.

from md-data-table.

orbatschow avatar orbatschow commented on July 30, 2024

For me it's not possible not to use ng-repeat, because the table head has a dynamic parameter size. (I don't know how much elements thead will contain).

I forked your Codepen http://codepen.io/anon/pen/OVoWbE

from md-data-table.

daniel-nagy avatar daniel-nagy commented on July 30, 2024

The reason row selection is not working is because you are using data-ng-repeat instead of ng-repeat in the table body. In the module I'm checking if the ng-repeat attribute exists.

I updated your Codepen.

Do you need to validate your HTML? For now you can use ng-repeat and row selection should work. I'm going to rename this issue to normalized attribute names.

from md-data-table.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.