This sample shows how to create quite complex composite control over empty <div>
.
Calling $.my only once we create all html markup and define its behavior.
You may click any word on the table (name or death reason) – list will be truncated to match the word.
Entire code – including html for templates and comments – is 100 lines long. Without comments it'll be 75 lines long. Without html templates – they can be prerendered in html body – code is 60 lines long.
Any time form is changed, div#sample
receives change
event. Filtered and sorted list
can be retrieved calling $("#sample").data("my").result
.