Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

152
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda