HTML and CSS Reference
In-Depth Information
The name of the file is the description of the task; the folder where the file is created or saved is
the roaming folder of the application. Note that files will be silently overwritten if the names match.
This means that you can't have two tasks with the same description.
Note that once the task has been saved, the user receives a confirmation message and the list of
tasks is automatically refreshed to include the newly created (or updated) task (see Figure 10-12).
FIGURE 10-12 The task has been successfully created.
Once the task is created successfully, the list view is refreshed and the newly created item is hidden
from view. The next step is selecting an existing item and editing it further.
Selecting tasks for editing
In Chapter 7, “Navigating through multimedia content,” you saw how to deal with the selection of
an item in a ListView component. It's the same here to select a task from the list and have it fully
displayed in the editor. You add an iteminvoked handler to the ListView . In todolist.js , add a new
method, as shown below:
TodoList.setupTaskList = function () {
var listview = document.getElementById("task-listview").winControl;
listview.itemTemplate = document.getElementById("task-listitem");
listview.addEventListener("iteminvoked", TodoList.taskSelected);
}
Search WWH ::




Custom Search