Results 1 to 2 of 2

Thread: Image grid - wrap items within panel

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Vote Rating

    Default Unanswered: Image grid - wrap items within panel

    I'm trying to put 100 images (50x50pixels) in a panel that is 500x500pixels. I want 10 images per line, right next to one another, filling up the entire panel. I've been stuck for 2 days on this, and would really appreciate help. The code as follows:

    note: i've also tried with a 10x10 array, listing each row as a different item with vbox, but it didn't work. thank you in advance for any help! = new Array(); //I put all the images into an array
    for (var i=0; i<100; i++){ //One by one, fill the array[i] = new Ext.Panel({
    width: 50,
    height: 50,
    style: 'background-color: #ff0000; border: thin solid blue;' //for simplicity here, just using solid colors instead of images

    App.views.ImageContainer = new Ext.Panel({ //The container, sized to hold 100 images
    App.views.ImageGrid = new Ext.Panel({
    layout: ????? //I haven't been able to get any layout to work
    items: []

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    If you will always know the number of items then you can simple do some CSS and use the Multi-column layout
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts