Elastic plugin takes the children of an element and rearranges them in a grid layout (like google+ or pinterest)
Check these 2 examples:
http://arcbees.github.io/gwtquery-elastic-plugin/ElasticWidgetSample/WidgetSample.html
http://arcbees.github.io/gwtquery-elastic-plugin/ElasticBasicSample/ElasticLayoutSample.html
To call the plugin:
import static com.arcbees.gquery.elastic.client.Elastic.Elastic;
ElasticOption option = new ElasticOption()
.withColumWidth(400)
.withMinimalNumberOfColumn(2);
$("#container").as(Elastic).elastic(option);
or you can use an ElasticHtmlPanel
and all direct children of the panel (html elements or widgets) will be rearranged in column.
The different options are:
To specify this option, you can use an ElasticOption
object and pass it to the plugin or uses the specific method directly on the ElasticHtmlPanel
On each child we can specify the following attributes: data-elastic-span: specify the number of column to span for this child. data-elastic-column: Force the child to be displayed in a specific column. "first" and "last" values are also accepted and the child will be displayed respectively in the first of in the last column no matter the number of column
There is no official release yet, but you can already use a snapshot version
<dependency>
<groupId>com.arcbees.gquery</groupId>
<artifactId>elastic</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>