Page 2 of 2

How to display an image from Tiggzi database?

Posted: Tue Dec 04, 2012 9:20 am
by Kateryna Grynko

Hi Antonia!

You can create new database service and select Query operation for your db collection. New RESTService with parameter "where" will be created. Parameter "where" has format '{"column_name": "element_value"}'. Service response returns collection data that satisfies entered request.

To use Edit mapping in request parameter "where" you have to map local storage variable or component to parameter "where" and add following JS code:
codereturn '{"column_name": "'+value+'"}';/code
To add this JS code press this button:
Image


How to display an image from Tiggzi database?

Posted: Tue Dec 04, 2012 2:29 pm
by Kateryna Grynko

I found a solution for you.
In the Image upload tutorial server returns filename on download success. It's possible to save filename in local storage variable using JavaScript code.
codesuccess: function(data)
{
// OPTIONAL, this is the file name under which the image was stored in database....
localStorage.setItem('db_file_name', data.filename);
}/code
Filename in database will be stored in local storage variable. You can save it in database collection to reuse it later.