Advertisement
Guest User

Untitled

a guest
Apr 7th, 2013
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.86 KB | None | 0 0
  1.     <body>
  2.  
  3.     <table border="1">
  4.         <thead>
  5.         <tr><th>Value</th></tr>
  6.         </thead>
  7.         <tbody data-bind="foreach: aligns">
  8.         <tr>
  9.             <td><input data-bind="value: value" placeholder="value" /></td>
  10.         </tr>
  11.         </tbody>
  12.     </table>
  13.    
  14.     <script type="text/javascript">
  15.         function align(value) {
  16.             return {
  17.                 value: ko.observable(value)
  18.             };
  19.         }
  20.    
  21.         var viewModel = {
  22.             aligns: ko.observableArray([new align("1h"), new align("2h"),
  23.                 new align("3h"), new align("4h"),new align("5h"), new align("6h"),
  24.                 new align("7h"), new align("8h"), new align("9h"),new align("10h"),
  25.                 new align("11h"), new align("12h")])
  26.         };
  27.    
  28.         ko.applyBindings(viewModel);
  29.     </script>
  30.    
  31.     </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement