Uploaded image for project: 'Documentation'
  1. Documentation
  2. TIDOC-2325

Ability to insert views at specific indexes

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      any

      Description

      Currently there’s no way to add views at a specific index of the children list.

      The only way to do this is something along the lines:

      function insertAt(parent, views, position) {
       // this one is slow…
       var children = Array.prototype.slice.call(parent.children);
       // this one is slowish too…
       parent.removeAllChildren();
       // and this one is very slow on android…
       parent.add((
         children.slice(0, position)
        ).concat(
         views
        ).concat(
         children.slice(position)
        )
       );
      }

      …which you already know will flash with no content for a small (yet sensible) time.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bhatfield Benjamin Hatfield (Inactive)
                Reporter:
                yuchi Pier Paolo Ramon
              • Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code