Skip to main content
1-Visitor
December 12, 2017
Question

How to fill a repeater in thingworx studio

  • December 12, 2017
  • 4 replies
  • 2412 views

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

21-Topaz I
December 13, 2017

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

1-Visitor
December 14, 2017

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

1-Visitor
December 15, 2017

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