12. triggered when there is a change in the
addTodo dataset state
when clicking enter in the input, trigger
the update process.
We blur from the input to force the
dataset to be updated, at which point
the dataset will trigger an item save
per the above function
save the state of addTodo Dataset to the
database. This saves the new todo item
refresh the todos Dataset, this will
update the repeater with the new item
update the statistics
13. Because the checkbox is in a repeater,
we need to get the right repeater item
$item represents the current repeater
item
Get the new value from the checkbox
Update the todos dataset with the new
value
Save the todos dataset state to the
database
14. Query for items without a completed flag
equals true
Set the itemsCount text
show the element only after first
setting statistics to prevent loading
blur
15. set the todos dataset to show all
elements
Disable / Enable the buttons
filter to show non complete items -
completed not equals true
filter to show complete items - completed
equals true
16. query all completed items
Remove all completed items
Refresh the todos dataset to update the
repeater