HTML and CSS Reference
In-Depth Information
Note also that developers are not entitled to suggest programmatically any start folder not listed
in the PickerLocationId enumeration. By design, only the predefined system folders can be presented
to the user. The PickerLocationId enumeration includes the folders listed in Table 9-3.
TABLE 9-3 Predefined system folders
The folder that provides access to all disks and connected devices.
The Windows desktop.
The user's Documents folder.
The folder where software is downloaded by default.
The folder that provides access to all computers in the home group.
The Music library folder.
The Pictures library folder.
The Videos library folder.
Similarly, you can suggest the name for the file to be saved. You do that through the Suggested-
FileName property. In the example above, you set the suggested file name to the description of the
task being created:
savePicker.suggestedFileName = currentTask.description;
Another parameter you can customize is the list of extensions recommended for the file being
created. In this case, you provide the .todo custom extension:
savePicker.fileTypeChoices.insert("TodoList Task", [".todo"]);
The commitButtonText property sets the caption of the button the user will need to click to save
Getting the name of the file to create
To display the user interface through which the user will be able to select a file to save, you need to
add the following code to the body of the TodoList.pickFileAndSaveTask function.
// Invoke the file picker
savePicker.pickSaveFileAsync().then(function (file) {
if (file) {
Search WWH ::

Custom Search