Dashcode For Dummies by Jesse Feiler

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



Copyright Disclaimer:
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.
Popular ebooks
Eco-friendly approach of bio-indigo synthesis and developing purification methods towards isolation of indigo from indirubin and bacterial fragments by Ramalingam Manivannan & Kaliyan Prabakaran & Young-A Son(207155)
Personalized inhaled bacteriophage therapy for treatment of multidrug-resistant Pseudomonas aeruginosa in cystic fibrosis by unknow(175589)
CONSORT 2025 statement: updated guideline for reporting randomized trials by unknow(84012)
Critical evaluation of the ProfiLER-02 study design and outcomes by Vivek Subbiah & Razelle Kurzrock(83689)
Cardiac gene therapy makes a comeback by Oliver J. Müller & Susanne Hille & Anca Kliesow Remes(83488)
Whisky: Malt Whiskies of Scotland (Collins Little Books) by dominic roskrow(74438)
Unveiling the design rules for tunable emission in graphene quantum dots: A high-throughput TDDFT and machine learning perspective by Şener Özönder & Mustafa Coşkun Özdemir & Caner Ünlü(50893)
A yeast-based oral therapeutic delivers immune checkpoint inhibitors to reduce intestinal tumor burden by unknow(40260)
Covalent hitchhikers guide proteins to the nucleus by Alexander F. Russell & Madeline F. Currie & Champak Chatterjee(40216)
Meet the Authors: Christopher R. Mansfield and Emily R. Derbyshire by Christopher R. Mansfield & Emily R. Derbyshire(40096)
Alkaline-earth metals promote propane dehydrogenation with carbon dioxide through geometric effects: Altering the reaction pathway by unknow(32731)
Induced iron vacancies boosting FeOOH loaded on sustainable Fenton-like collagen fiber membrane for efficient removal of emerging contaminants by unknow(32507)
Efficient electric-field-assisted photochemical conversion of methane to n-propanol exclusively over penetrated TiO2Ti hollow fibers by Guanghui Feng(32453)
Bi2SiO5 nanosheets as piezo-photocatalyst for efficient degradation of 2,4-Dichlorophenol by Hangyu Shi & Yifu Li & Lishan Zhang & Guoguan Liu & Qian Zhang & Xuan Ru & Shan Zhong(32387)
A novel NDIPTA organic heterojunction photocatalyst with built-in electric field for efficient hydrogen production by Jiahui Yang & Baojun Ma & Yongfa Zhu(32361)
Enhanced conversion of methane to liquid-phase oxygenates via hollow ferrite nanotube@horseradish peroxidase based photoenzymatic catalysis by Jun Duan & Shiying Fan & Xinyong Li & Shaomin Liu(32333)
Ordered macroporous superstructure of defective carbon adorned with tiny cobalt sulfide for selective electrocatalytic hydrogenation of cinnamaldehyde by Xiao-Shi Yuan & Sheng-Hua Zhou & San-Mei Wang & Wenbo Wei & Xiaofang Li & Xin-Tao Wu & Qi-Long Zhu(32257)
What's Done in Darkness by Kayla Perrin(27148)
Topological analysis of non-conjugated ethylene oxide cored dendrimers decorated with tetraphenylethylene: Insights from degree-based descriptors using the polynomial approach by A Theertha Nair & D Antony Xavier & Annmaria Baby & S Akhila(26523)
Investigation of mechanical and self-healing properties of hydroxyl-terminated polybutadiene functionalized with 2-ureido-4-pyrimidinone by Mohsen Kazazi & Mehran Hayaty & Ali Mousaviazar(26458)