Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Need Help with DashboardView

If I wanted a dashBoard with 2x3 and not 3x3(default) how do I create it???
I want a dashBoard with the height 250px and with about 9 Items in it.
So my dashBoard would have 6(2x3) on the first screen and 3 on the second screen

I tried setting the height of the dashBoard but had no luck. The height changes but the Items does not get moved to the second screen.

var data = [];
var labels = ['account','cases','calls','contacts','emps','leads','meetings','opps','tasks'];
for (var c=0;c<labels.length;c++)
{
    var item = Titanium.UI.createDashboardItem({
        image:'../images/dashboard/'+labels[c]+'_off.png',
        selectedImage:'../images/dashboard/'+labels[c]+'_on.png',
        label:labels[c]
    });
    if (c==0) item.badge = 10;
    data.push(item);
}


var dashboard = Titanium.UI.createDashboardView({
    data:data,
    height:250
});
win.add(dashboard);

Has anyone done this in the past Please help..

And Thanks for the Help

— asked November 10th 2010 by Stephen Jeevaratnam
  • dashboardview
0 Comments

4 Answers

  • Anyone??

    — answered November 11th 2010 by Stephen Jeevaratnam
    permalink
    0 Comments
  • Well…you have 9 icons…so take 3 away and you'll get 2 rows of 3…

    — answered November 12th 2010 by Josh Lewis
    permalink
    0 Comments
  • I had tried for quite a while to make a 2x2 grid. I was finally able to get the layout correct… but because I was passing in the images to the itemview.. I wasn't able to use the "selectedImage" attribute..

    I just ended up going another direction with my layout..

    — answered November 12th 2010 by Critter
    permalink
    0 Comments
  • The dashboard view is kind of a pre-canned widget - it doesn't offer a whole lot in terms of customization at this point in time. You might be better off rolling your own solution with Views and Images - it will ultimately be more flexible for you.

    — answered November 12th 2010 by Kevin Whinnery
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.