-2

enter image description here

How can i achieve the above table column calculation using knockout.js. I can implement the same using jquery, but as I'm beginner to knockout.js i don't know the implementation using knockout.js.

I don't want to generate the above mentioned table using Json, instead i will generate this table directly in HTML table itself. Here is the HTML code

    <table>
         <thead>
             <tr>
                <th>Price</th>
                <th>Quantity</th>
                <th>Amount</th>
             </tr>
         </thead>
         <tbody>
             <tr>
                 <td><input type="text"></td>
                 <td>2</td>
                 <td></td> 
             </tr>
             <tr>
                 <td><input type="text"></td>
                 <td>1</td>
                 <td></td> 
             </tr>
              <tr>
                 <td><input type="text"></td>
                 <td>2</td>
                 <td></td> 
             </tr>
              <tr>
                 <td><input type="text"></td>
                 <td>100</td>
                 <td></td> 
             </tr>    
         </tbody>

Any Suggestions?

Asif
  • 1,775
  • 4
  • 25
  • 39

1 Answers1

0

Wrong tool for the job. Knockout is about binding your data to HTML, not manipulating text in HTML. I.d suggest using a selector in jquery and summing those values.

Jason Goemaat
  • 28,692
  • 15
  • 86
  • 113