cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

How to fill a repeater in thingworx studio

jsladojevic
1-Newbie

How to fill a repeater in thingworx studio

Hello,

I'm new to thingworx studio and have to get familiar with it.

i have objects, that each have an image(contained in my Resources), a title and a description. In the later code those will be retrieved dymanically and can be of arbitrary number.

For now i've created test-data like this:

  var obj1 = ["img1", "title1", "description1"];

  var obj2 = ["img2", "title2", "description2"];

  var obj3 = ["img3", "title3", "description3"];

i guess the best way to display them would be in a repeater. So I have created one and filled it with an image view and two labels.

How do i assign the date to it? (I know how to assign text to a label using application parameters)

4 REPLIES 4

Hi Jovan. You can utilize getDate(), getMonth(), and getYear() JS functions to get the desired date you are looking for.

Sorry, I don't understand your answer. How are these functions going to help me set the data for my repeater?

Whoops. In your initial question it looked like you had asked about adding the date, not data. What data are you looking to assign to your repeater?

as described i want to assign the test-data, to be more elaborate, each view should have title(represented as a label), an image and a descriptiuon(also a label).

So if my data is for ex.:


var obj1 = ["img1", "title1", "description1"]; 

var obj2 = ["img2", "title2", "description2"]; 

var obj3 = ["img3", "title3", "description3"];

var data = [obj1, obj2, obj3];


the repeater should have 3 items: the first item would have the title "title1", the image from resources called "img1" and the description "description1".

The second item  would have the title "title2", the image from resources called "img2" and the description "description2" and the third likewise

Top Tags