Results 1 to 2 of 2

Thread: Multiple list items per line (Sencha Touch 2.4.2)

  1. #1
    Sencha Premium User
    Join Date
    Oct 2015
    Location
    Grand Rapids, Michigan
    Posts
    8

    Default Multiple list items per line (Sencha Touch 2.4.2)

    I currently have a list grouped on a specific field, but I'm looking for a way to render multiple list items per line within those groups. I've read this thread from 2012 where it's mentioned that it's not possible to add groupers to dataview items (which is essentially what I'm attempting to do):

    https://www.sencha.com/forum/showthr...-with-dataview

    Is it possible to prevent individual list items from line breaking while still having category titles between them?

  2. #2
    Sencha User
    Join Date
    Jan 2016
    Posts
    462
    Answers
    60

    Default

    I have done this before but it was not simple. First you would need to create a temporary store that groups your items into a record with the record containing as many items are you want per row and the grouping name as a field. Then in your itemTpl you need to loop through each item and display it. In your listener, you have to use a delegate so that you know which item you tapped in the row.

    I also removed all the default events using the following:
    Code:
     this.container.innerElement.un({
                touchstart: 'onItemTouchStart',
                touchend: 'onItemTouchEnd',
                tap: 'onItemTap',
                taphold: 'onItemTapHold',
                singletap: 'onItemSingleTap',
                doubletap: 'onItemDoubleTap',
                swipe: 'onItemSwipe',
                delegate: '.' + Ext.baseCSSPrefix + 'list-item',
                scope: me
            });
    Not simple, but can be accomplished. I would give you my code, but it was not abstracted enough and would need too many modifications.

Similar Threads

  1. Inner items not visible in sencha touch list 2.2
    By irshadnk in forum Sencha Touch 2.x: Discussion
    Replies: 3
    Last Post: 27 Apr 2013, 9:34 AM
  2. Sencha Touch Charts 2 Multiple Y Axes Line Chart
    By QuestingForTruth in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 18 Jul 2012, 5:01 AM
  3. Sencha Touch Carousel show multiple items
    By acorotchi in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 19 Apr 2012, 6:51 AM

Posting Permissions

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