Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10493] iOS: DashboardView rowCount and columnCount properties

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2013-04-22T16:31:49.000+0000
Affected Version/sRelease 3.0.0
Fix Version/s2013 Sprint 08 API, 2013 Sprint 08, Release 3.1.1, Release 3.2.0
ComponentsiOS
Labelsapi, community, module_dashboardview, qe-closed-3.1.1, qe-testadded, triage
ReporterRussell Frank
AssigneeVishal Duggal
Created2012-08-20T09:27:29.000+0000
Updated2013-11-19T23:32:29.000+0000

Description

We should be able to specify a rowCount and columnCount when creating a DashboardView.

Comments

  1. Russell Frank 2012-08-20

    Pull request opened on Github: [#2782 iOS: DashboardView rowCount and columnCount properties](https://github.com/appcelerator/titanium_mobile/pull/2782)
  2. Shyam Bhadauria 2012-08-31

    Environment used for verification - Tested with Titanium SDK: 2.2.0.v20120830182512 Tested with Titanium  Studio: 2.1.2.201208301612 Device - Simulator iOS 5.1 Machine OS - MAC 10.8
  3. Danny Pham 2013-04-03

    Property "rowCount" does not work, tested with SDK 3.0.2.GA Seems like value is not set in TiUIDashboardView.m:
       int rowCount = [TiUtils intValue:[self.proxy valueForKey:@"rowCount"] def:kDashboardViewDefaultRowCount];
       NSLog(@"### rowCount: %d", rowCount);
       
    Always returned the predefined number. Curiously columnCount works properly. Also see https://developer.appcelerator.com/question/149207/columncount-and-rowcount-do-not-work-well-in-dashboardview
  4. Neeraj Gupta 2013-04-03

    Reopening based on latest comments.
  5. Russell Frank 2013-04-04

    @Danny: The property is marked as 'creation' in the docs because it's only available when you create the object. You can't set it on the proxy and have it change the rowCount and columnCount. This is because the items are laid out in an array of pages and there currently isn't code to relayout across pages if the counts change. I'm not sure how Alloy handles properties in the XML, but it appears that it probably tries to set them on the proxy *after* running the factory function, which will of course not work.
  6. Danny Pham 2013-04-04

    I don't use Alloy and of course I set the property in the creation statement:
       var dashboard = Ti.UI.createDashboardView({
       	data: data, // previously created and saved to array
       	rowCount: 2,
       	columnCount: 3,
       	wobble: true,
       	top: 60,
       	height: 250
       });
       
  7. Vishal Duggal 2013-04-17

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/4181 For workaround in current implementation call setData explicitly after creating the proxy (Remove data from creation dict).
  8. Vishal Duggal 2013-04-22

    Backport to 3_1_X https://github.com/appcelerator/titanium_mobile/pull/4201
  9. Sabil Rahim 2013-04-22

    code for testing

       
       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;
         }
       }
       
       var dashboard = Ti.UI.createDashboardView({
           data: items[0], // previously created and saved to array
           rowCount: 2,
           columnCount: 3,
           wobble: true,
           top: 60,
           height: 250
       });
       
       var win = Ti.UI.createWindow({
       	backgroundColor:'white',
       });
       win.add(dashboard);
       win.open();
       
       
  10. Olga Romero 2013-05-07

    Tested with the code above, using: Appcelerator Studio, build: 3.1.1.201305062045 SDK, build: 3.1.1.v20130503173050 Devices: iPhone5 iOS 6.1.4 iPad4 iOS 6.1.3 Property columnCount works properly

JSON Source