daniel-nagy / md-data-table

Material Design Data Table for Angular Material
MIT License
1.9k stars 520 forks source link

not able to sort on columns created with ng-repeat #558

Open shroffshyam opened 7 years ago

shroffshyam commented 7 years ago

when you click on question column all the columns by question collection is selected and also sorting method is not called either `

`
monzol commented 7 years ago

@shroffshyam: I think you got your md-order-by attribute wrong. Are you trying to order by the value returned by the getScoresByQuestionId(question) call? What does it return? The md-order-by attribute should refer to a field name that is part of the row data set. So to take an example from the demo, if you have

<tr ... ng-repeat="dessert in desserts.data ..." ...> then in your calories column, you should have <th md-order-by="calories.value" ... > which comes from dessert.calories.value. Could you also include the rest of the table definition?

Name Score {{question}}