Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

151
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda