1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    416
    Vote Rating
    18
    Answers
    5
    jweber will become famous soon enough

      0  

    Default Unanswered: Insert non-store item into DataView?

    Unanswered: Insert non-store item into DataView?


    Is there a good way to insert a component into a DataView, that doesn't correspond to an item in the store? For example, I might want to add a header at the beginning, or a divider in the middle.

    I know I could add a docked component, but I'm looking for something that would scroll along with the rest of the items (and use the same horizontal or vertical layout as the items).

  2. #2
    Sencha User
    Join Date
    Jul 2012
    Posts
    148
    Vote Rating
    10
    Answers
    12
    pentool will become famous soon enough

      0  

    Default


    Well, what comes to mind (out of the blue) is that you could build the dataview using an XTemplate. In the template you can have variables and all sorts of other things (check the docs).

    So let's say you want to insert a divider, or some component at every n'th place. You could check the xindex template variable if it's, say (xindex % n'th === 0). If so, just insert a divider or something rather.

Thread Participants: 1

Tags for this Thread