javascriptdjangojquery-uijquery-ui-selectable

Why selectable list of items doesn't work in Django?


The jdango view returns list of components and the li items contain html code saved in {{ component.html }} variable.

html file:

<ol id="app_components">
  {% for component in components %}
    <li id="{{ component.id }}" class="component">
    {{ component.html|safe }}
    </li>
  {% endfor %}
</ol>

js file:

$( "#app_components" ).selectable();

css file:

.ui-selecting {
  background: grey;
}
.ui-selected {
  background: blue;
}

I don't know why not works. Any idea ? Thanks.


Solution

  • Change strategy, changed jQuery UI selectable to sortable documentation