Submit your widget

Sortable text list with jQuery

Created 6 years ago   Views 35497   downloads 5820    Author javve
Sortable text list  with jQuery
View DemoDownload 219.5 KB
123
Share |

this is a 3 KB cross-browser native JavaScript that makes your plain HTML lists super flexible, searchable, sortable and filterable. Yeah!
Do you also want the possibility to add, edit and remove items by dead simple templating?

HTML

<div id="example-list">
    <input class="search" />
    <span class="sort" data-sort="feature">Sort features</span>
    <ul class="list">
       <li>
           <span class="feature">Search</span>
           <small class="description">Search through all items.</small>
       </li>
       <li>
           <span class="feature">Sort</span>
           <small class="description">Sort lists by value that
               you choose.</small>
       </li>
       <li>
           <span class="feature">Filter</span>
           <small class="description">
                Write your own filter functions.
            </small>
       </li>
       <li>
           <span class="feature">Add</span>
           <small class="description">Add items on the fly.</small>
       </li>
       <li>
           <span class="feature">Get</span>
           <small class="description">Get item based on value.</small>
       </li>
       <li>
           <span class="feature">Update</span>
           <small class="description">Update items as you go.</small>
       </li>
       <li>
           <span class="feature">Remove</span>
           <small class="description">
                Remove items whenever you feel like.
            </small>
       </li>
    </ul>
</div>

JavaScript

var options = {
    valueNames: [ 'feature', 'description' ]
};

var featureList = new List('example-list', options);

Read more:https://github.com/javve/list