Writing by Peter Hilton

Play/Slick back-end for jQuery UI Sortable

A new Typesafe Activator template 2014-08-12 #Scala

For a programmer, two especially useful ways to learn to use new technologies are tutorials and sample applications. The problem with sample applications, though, is that application source code is not linear, and it can be difficult to discover a useful way to approach it.

Typesafe Activator

Tutorials provide a guided linear flow, but make it difficult to see the big picture. A challenge when writing a book like Play for Scala is to include enough context with code snippets to allow the reader to see how they relate to each other, while avoiding listings that are too long to follow. The usual compromise is to first explain a series of short snippets, and then repeat the code in one long listing.

Typesafe Activator cleverly combines the ability to browse and run sample applications with linear tutorials, and therefore has the potential to be more useful than conventional programming books. I decided to try it out, and wrote my own Activator template.

Play Framework with Slick back-end for jQuery UI Sortable

Play Framework with Slick back-end for jQuery UI Sortable is a new Activator template that demonstrates how to integrate jQuery UI Sortable with a Play Framework 2.3.3 (Scala) back-end that uses Slick 2.1.0 for persistence. The template page includes instructions for use.

In case you were wondering, jQuery UI Sortable is a JavaScript library that allows you to reposition elements in an HTML list with drag and drop. If you add a persistent server-side back-end then you can use this to add manual-reordering to a web application user-interface.

For example, you could write a new front-end for GitHub Issues that lets you manually order a Scrum product backlog. This is of course not included in the Activator template, but left as an exercise for the reader.

Template source: github.com/hilton/activator-slick-sortable

Share on TwitterShare on LinkedIn