Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
Knockout and DataTable and custom data binding

In ASP.NET MVC Project I am using Knockout and DataTable for data binding,

I add data to table like that:

    <tbody data-bind="dataTablesForEach: {data: customerList, dataTableOptions: tableOptions}">
       <tr>
          <td data-bind="text: customerName"></td>
          <td data-bind="text: creationDate"></td>
          <td data-bind="text: transType"></td>
          <td data-bind="text: address"></td>
       </tr>
    </tbody>

But in my case the customers list, each item contains sub list called skillsList So, I want to add data to table like that:

    <tbody data-bind="dataTablesForEach: {data: customerList, dataTableOptions: tableOptions}">
       <tr>
          <td data-bind="text: customerName"></td>
          <td data-bind="text: creationDate"></td>
          <td data-bind="text: phone"></td>
          <td data-bind="text: address"></td>
          <td data-bind="text: mainSkill"></td>
       </tr>
       
       foreach(var skill in skills) 
       {
          <tr>
             <td data-bind="text: customerName"></td>
             <td data-bind="text: creationDate"></td>
             <td data-bind="text: phone"></td>
             <td data-bind="text: address"></td>
             <td data-bind="text: skill"></td>
          </tr>
       }
       
    </tbody>

So, In the second tr the data is repeated but last td will contain skill instead of main skill

I hope you understand what I need

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I'm not sure if this will work, but I would be trying something like this,

<tbody data-bind="dataTablesForEach: {data: customerList, dataTableOptions: tableOptions}">
   <tr>
      <td data-bind="text: customerName"></td>
      <td data-bind="text: creationDate"></td>
      <td data-bind="text: phone"></td>
      <td data-bind="text: address"></td>
      <td data-bind="text: mainSkill"></td>
   </tr>
   <!-- ko dataTablesForEach: {data: skills, dataTableOptions: tableOptions}

      <tr>
         <td data-bind="text: customerName"></td>
         <td data-bind="text: creationDate"></td>
         <td data-bind="text: phone"></td>
         <td data-bind="text: address"></td>
         <td data-bind="text: skill"></td>
      </tr>
   <!-- /ko -->
</tbody>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!