Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have Models "Category" & "SubCategory". CategoryID is foreign key in SubCategory Table. I need to fetch all the Category and related SubCategories and bind in an Accordion list.

This is my code :
XML
<pre lang="HTML">
<div id="accordian" data-bind="foreach:Categories">
   <div class="panel-heading">
      <h4 class="panel-title"><span data-bind="text: CategoryName"></span></h4>
   </div>
   <div class="panel-body">
      <ul data-bind="foreach:SubCategories">
         <li><a href="#"><span data-bind="text: SubCategoryName" ></span></a></li>
      </ul>
   </div>
</div>

Please help me on this, i am new to knockoutjs Webapi

Thanks in advance
Posted
Updated 29-Apr-15 0:42am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900