WebOS Boston Developing for WebOS

11Oct/093

Mojo Lists: Using the Depot as a Data source (Part 4)

Written By: Joseph Crawford

In this tutorial we are going to cover using the Depot as a data source for a list. We will be expanding on the code written in the previous parts of this tutorial listed below.

Part 1: Mojo Lists
Part 2: Mojo Lists: Using a Cookie as a Data Source
Part 3: Mojo Lists: Restructuring our Code

If you were able to follow along with using the cookie as a data source this is going to be relatively easy for you to integrate into the existing code.

3Oct/091

Mojo Lists: Restructuring our Code (Part 3)

Written By: Joseph Crawford

In Part 2 of this series we created the ability to use a cookie for a lists data source. In this part we are going to cleanup our code a bit and try to restructure things so that it is easier to expand on our set of code.

After looking at the code I saw that we created the WBCookie model object that was not very abstract. We wish to keep things somewhat abstract so that the application is not concerned too much about where the data is coming from. We are going to be creating a few files that will be in our lib/ directory and I will explain why we are using them and what they do as we continue through the tutorial.

The first thing I want you to do is open up your sources.json file and add 3 lines at the top. We will want to include the files that we will be creating so that Mojo will know where to find them. Open your file and make it look like the following. Note that I only added the first three lines to this file.

Tagged as: , , , 583 Views Continue reading

Navigation

Calendar

<<Jul 2010>>
MTWTFSS
28 29 30 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1

Most Viewed

Categories

StatPress

Visits Today: 3
Total Visits: 3989
Guests Online: 0
Members Online: 0

Archives

Tag Cloud

authors books Bugs Cookie Depot Development directions JavaScript Lists Meetings Mojo Organization Palm Storage Tutorial WebOS WebOS Boston