Dashcode For Dummies by Jesse Feiler
Author:Jesse Feiler
Language: eng
Format: epub
Publisher: Wiley
Published: 2010-12-05T16:00:00+00:00
Creating a Data Source
The Browser template has its files and data sources all created for you, which puts you well on the road to completing a project of your own. But where did they come from? If you have to build your own data sources, how do you do it? You can’t just live with the Browser template and its built-in National Parks data forever. Here’s how you create files, data sources, and data models.
Start by showing the data sources and selecting the top data source (called dataSource) — refer to Figure 9-5). Delete it by choosing Edit⇒Delete or by using the Delete key.
When you select the data source, make certain that you select the data source itself and not its title. If the text of the data source title is selected, when you delete, that’s all you’ll delete — the text.
When you delete the top data source, any other data sources also disappear.
Choosing the data to use
When you’re contemplating a Dashcode project that will include data, you have four choices:
File: You can use a file as the Browser template does. The file must be formatted as JSON or XML. You should add the file to your project and specify that filename as the URL of the data source. (For more on this topic, see the next section, “Adding a file to your project.”)
Because the file is included in the project, any changes to the data require changing the project.
Dynamic: You can access a Web service or other program on the Web via a URL. You specify that URL in the data source exactly as you do for a file. Dashcode expects exactly the same format of the data from an included file or a dynamic data source; it’s up to you to ensure that happens.
If you place a file somewhere on the Internet (or a local area network), that URL can point to the file. It’s included as a dynamic data source because you can modify it outside the project even if it’s a file. This technique — specifying the URL of an external file — is very useful for data that changes. Whoever is responsible for updating the data only has to make certain that the current file is available and is in the right format. If you begin with a file that you create, updating it may be as simple as just copying and pasting changed data into a copy of the file.
Static: If the amount of data you need is relatively small and unchanging, you can simply type the data into your interface inside a text field, text area, or text part from the Library.
XMLHttpRequest: You can use XMLHttpRequest to get a specific item of data when you need it. This request doesn’t involve a data source because you’re just retrieving data and displaying it somewhere. You can see how to make this request in Chapter 11.
Adding a file to your project
To add a file to your project, show the Files list (refer to Figure 9-3).
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
What's Done in Darkness by Kayla Perrin(26623)
The Fifty Shades Trilogy & Grey by E L James(19101)
Shot Through the Heart: DI Grace Fisher 2 by Isabelle Grey(19089)
Shot Through the Heart by Mercy Celeste(18956)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 10 by Isuna Hasekura and Jyuu Ayakura(17142)
Python GUI Applications using PyQt5 : The hands-on guide to build apps with Python by Verdugo Leire(17033)
Peren F. Statistics for Business and Economics...Essential Formulas 3ed 2025 by Unknown(16905)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 03 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(16844)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 01 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(16472)
The Subtle Art of Not Giving a F*ck by Mark Manson(14397)
The 3rd Cycle of the Betrayed Series Collection: Extremely Controversial Historical Thrillers (Betrayed Series Boxed set) by McCray Carolyn(14163)
Stepbrother Stories 2 - 21 Taboo Story Collection (Brother Sister Stepbrother Stepsister Taboo Pseudo Incest Family Virgin Creampie Pregnant Forced Pregnancy Breeding) by Roxi Harding(13692)
Scorched Earth by Nick Kyme(12791)
The Ultimate Python Exercise Book: 700 Practical Exercises for Beginners with Quiz Questions by Copy(11229)
D:\Jan\FTP\HOL\Work\Alien Breed - Tower Assault CD32 Alien Breed II - The Horror Continues Manual 1.jpg by PDFCreator(11191)
De Souza H. Master the Age of Artificial Intelligences. The Basic Guide...2024 by Unknown(11159)
Drei Generationen auf dem Jakobsweg by Stein Pia(10987)
Suna by Ziefle Pia(10906)
Scythe by Neal Shusterman(10375)
