Search code examples
ember.jsember-drag-sort

Ember-Drag-Sort: Custom HTML element


is it possible to specify a custom element tag for the .dragList ? In my scenario right now I need it to be a <ul> as I'm rendering my items wrapped inside of <li> - trying to avoid having to create a fork.

something like this...

    = drag-sort-list [
      tagName="ul"
      childTagName="li"
      class="someClass"
    ]

and instead of default rendering a for the list we could render the tagName passed in - would also be nice to be able to pass down a custom class for the parent list as well


Solution

  • You can configure tag names of both drag-sort-list and drag-sort-item components:

    {{#drag-sort-list
      tagName      = "article"
      childTagName = "section"
    }}
    

    tagName is built into every Ember component.

    childTagName is described in the addon's readme.