Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
here i am retrieveing a list of data from database, and passing it into knockoutmapping object and binding it....my issue is i have to group the data based on date which i got it from db and in UI i am displaying it in a table. and i should have two same dated data in single row, but same dates are displayng in two different rows which i have done


my code is:
XML
<script lang="en" type="text/javascript">
    $(function () {
        var viewModel = {
            homeWorkList: ko.mapping.fromJS(@Html.Raw(Json.Encode(Model)))
        };
        ko.applyBindings(viewModel);
    });

</script>
 <h1> Home-Work <small>Daily</small></h1> <hr>

 <div class="tab-pane fade active in">
     <h3>class VI<small> Section B </small></h3>
          <br>
<table class="table table-bordered">
    <thead>
        <tr>
          <th width="6%">@Resources.StudentHomeWorkDate</th>
           <th width="4%">@Resources.StudentHomeWorkSubject</th>
          <th width="26%">@Resources.StudentHomeWork</th>

          </tr>
         <tbody data-bind="foreach: homeWorkList">


             <tr >

                 <td data-bind="text:HomeWorkDate"></td>
                <td data-bind="text:HomeWorkSubject" > </td>
                 <td data-bind="text:HomeWorkDescription"></td><td data-bind="text:HomeWorkDescription"></td>


             </tr>
             </tbody>

      </thead>

</table>

     </div>
Posted

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