Results 1 to 2 of 2

Thread: Insert non-store item into DataView?

  1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    443
    Answers
    5
    Vote Rating
    18
      0  

    Default 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
    Answers
    12
    Vote Rating
    10
      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.

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
  •