appcelerator/titanium_mobile — pull request #2782 by russfrank (2012-08-20 16:28:23+00:00)
Title: [TC-1190] iOS: DashboardView rowCount and columnCount properties

JIRA: [TC-1190](https://jira.appcelerator.org/browse/TC-1190)

Hi! I've had to continue using this code despite my wishes to move away from it, and as such I've added the ability to specify the row count and column count on creation.

I realize this might not be the direction y'all want to go with this. This changes the behavior; previously, if the frame was made small enough, the view would reduce the number of rows. Now, if a reduced number of rows is desired, it must be explicitly specified upon creation.

If you'd rather allow the `rowHeight` to be specified, I can do that too, though I think this makes more sense.

Here is a test case that creates a couple of views with different row/col counts:

```javascript
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
});

var win2 = Titanium.UI.createWindow({
title:'Tab 2',
backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({
icon:'KS_nav_ui.png',
title:'Tab 2',
window:win2
});

var win3 = Titanium.UI.createWindow({
title:'Tab 2',
backgroundColor:'#fff'
});
var tab3 = Titanium.UI.createTab({
icon:'KS_nav_ui.png',
title:'Tab 2',
window:win3
});

tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.addTab(tab3);
tabGroup.open();

var dash1 = Ti.UI.createDashboardView({
columnCount: 2,
rowCount: 2
});

// columnCount and rowCount should default to 3
var dash2 = Ti.UI.createDashboardView();

var dash3 = Ti.UI.createDashboardView({
columnCount: 4,
rowCount: 4
});

var items = [[], [], []];

for (var j = 0; j < 3; j++) {
for (var i = 0; i < 20; i++) {
var item = Ti.UI.createDashboardItem();
item.add(Ti.UI.createLabel({
text: "item numba " + i,
borderColor: '#'+i+'0'+i+'000',
borderWidth: 3,
height: 'fill', width: 'fill'
}));
items[j][i] = item;
}
}

dash1.setData(items[0]);
dash2.setData(items[1]);
dash3.setData(items[2]);

win1.add(dash1);
win2.add(dash2);
win3.add(dash3);
```