0

How to achieve a hideable Table Row in Angular JS ?

I need to display a Database Table A , and on click of Table A's record , it shows a one to many mapping from Table B [going by A's Primary IDN] . Table B has many records for each record in A . I tried various approaches but none works . For example Table inside Table won't work . Div inside Div has issue with margins . Is there an existing approach for this ? I am looking for a collapsible table attached to a main table . I find ng-repeat to have some limitations as it won't loop outside of the element which is handy in these cases .

Record 1 Date Name(-)  //To show its collapsed
   Record1's Book1 Name Author
   Record1's Book2 Name Author
Record 2 Date Name(+)  //Uncollapsed

http://www.javascripttoolbox.com/jquery/ has a good demo of the feature I am looking for .

1 Answer 1

2

Here's an example that I wrote that your looking for : http://plnkr.co/edit/IQ6uSmDKMzw0G3g425PI?p=preview

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks was not aware of the if logic in Angular . Will have a look . Also I need the inner content to be a table too like the outer one ! A bit like : jsfiddle.net/nishantvarma/98SGz
ng-repeat-start and ng-repeat-end is what was missing from my understanding ! I Wasn't aware it can stretch across tags .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.