Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ul id="todo">
- <li rv-each-todo="list.todos">
- <input type="checkbox" rv-idx="todo.idx" rv-checked="todo.done">
- <span>{ todo.summary }</span>
- </li>
- <ul>
- <input rv-editing-idx="133"></input>
- <ul id="todo">
- <li rv-each-todo="list.todos">
- <input type="radio" rv-idx="todo.idx" rv-checked="todo.done" name="todo" rv-on-change="list.change">
- <span>{ todo.summary }</span>
- </li>
- <ul>
- <input id="changeele" rv-value="summary"></input>
- var ele = document.getElementById('changeele');
- var eleBinding = rivets.bind(ele, {});
- var list = {
- "todos": [
- {"idx":133, "done":true,"summary":"Eat"},
- {"idx":25, "done":false,"summary":"Code"},
- {"idx":33, "done":false,"summary":"Sleep"},
- {"idx":24, "done":false,"summary":"Repeat"}
- ],
- "change": function(event, scope) {
- eleBinding.unbind();
- eleBinding = rivets.bind(ele, scope.list.todos[scope.index]);
- }
- }
- rivets.bind(document.getElementById('todo'), {list: list})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement