0

I have a controller in which I have a table view like this:

<TableView id="reservedScroll"  dataCollection="queue"  dataTransform="transformFunction"  dataFilter="reservedByDate"  layout="vertical" >
    (some rows) 
</TableView>

I create 6 object of this controllers and push them into a scrollable view

for (var i = 6; i >= 0; i--) {
    $.scrollableView.addView(Alloy.createController('dateQueues', {index : i}).getView());
}

In this case I filter the collection 6 times (filtering each table by different date)

The problem is it's taking really long time to load (about 15-20 seconds) , so it made me wonder if my solution is a good titanium programming practice.

Any thoughts? thanks!

Kobi Burnley
  • 105
  • 1
  • 2
  • 10

1 Answers1

1

Controller is too heavy-weight to be created in a loop.

Try splitting your controller into several parts (templates) and using them instead. More info in this tutorial

WeMakeSoftware
  • 9,039
  • 5
  • 34
  • 52