Joseph Yeung
Posts: 0
Joined: Tue Aug 14, 2012 7:48 am

Retrieving Data Rows from Local Storage One by One

Hi, Tiggzi Team.

What I have done:
Image

So, onSuccess of the REST service, I have stored the data rows in the local storage.

Next:
I would like to show the rows of data ONE BY ONE when the user presses a forward button (or a backward button for the previous row of data).

Image

My question:
However, the preceding code fails, either because "response is undefined" or because "innerHTML is null" etc.

Any suggestion, please?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Retrieving Data Rows from Local Storage One by One

Hello,

Tiggzi has its own functions for work with components.

You have to change JavaScript code. Replace codedocument.getElementById("ComponentName").innerHTML = row.question;/codewith
codeTiggzi("ComponentName").text(row.question);/code

Joseph Yeung
Posts: 0
Joined: Tue Aug 14, 2012 7:48 am

Retrieving Data Rows from Local Storage One by One

It works.

Big thanks. I would post the tweaks I made for others' reference here.

Joseph Yeung
Posts: 0
Joined: Tue Aug 14, 2012 7:48 am

Retrieving Data Rows from Local Storage One by One

Here we go.

Event: onSuccess of the Tiggzi Database REST service:
Image

Note: to declare the variables global, "window.variable" javascript format is used, otherwise the variables cannot be used on other events.

Event: onClick of a forward button:
Image

That's it.

Return to “Issues”