PhoneGap Mobile Application Development Cookbook by unknow
Author:unknow
Language: eng
Format: epub
Publisher: Packt Publishing
Finally, let's add the clearValues function, which will reset all form fields on the page where the input type is text.function clearValues() { $('input[type=text]').each(function() { $('#' + this.id + '').val(''); }); }
When we run the application on the device and select a contact, the resulting page would look like the following screenshot:
How it works...
In this recipe we extended the previous code to fulfill the desired functionality. We amended the initial code when we looped over the returned array of Contact objects and added in some code to set each Contact object into the localStorage database available on the device, using its ID property as the key for the storage entry.
When a contact was selected from the list, we were able to use that list item's ID attribute to obtain the saved Contact object from the localStorage database before taking the user to the next page by using the jQuery Mobile framework mobile.changePage() function.
With the Contact object stored in an accessible variable, we were then able to read the properties set within it and output them to the user.
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.
Deep Learning with Python by François Chollet(12708)
Hello! Python by Anthony Briggs(10010)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9879)
The Mikado Method by Ola Ellnestam Daniel Brolund(9877)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(9842)
Dependency Injection in .NET by Mark Seemann(9422)
Hit Refresh by Satya Nadella(8875)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8391)
The Kubernetes Operator Framework Book by Michael Dame(8019)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7843)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7809)
Exploring Deepfakes by Bryan Lyon and Matt Tora(7805)
Grails in Action by Glen Smith Peter Ledbrook(7776)
Practical Computer Architecture with Python and ARM by Alan Clements(7757)
Implementing Enterprise Observability for Success by Manisha Agrawal and Karun Krishnannair(7723)
Robo-Advisor with Python by Aki Ranin(7704)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7657)
Building Low Latency Applications with C++ by Sourav Ghosh(7608)
Svelte with Test-Driven Development by Daniel Irvine(7592)
