Buy me a coffee :)

Wicket - jQuery UI

jQuery UI integration in Wicket 6.x, Wicket 7.x , Wicket 8.x & Wicket 9.x

Behavior (kendoTreeView)

  • My Web Site
    • images
      • logo.png
      • body-back.png
      • my-photo.jpg
    • resources
      • pdf
        • brochure.pdf
        • prices.pdf
      • zip
    • about.html
    • contacts.html
    • index.html
    • portfolio.html

Components / Samples

Description

Since

wicket-kendo-ui-6.22.0

Licensing

Kendo UI "Core" is Apache License 2.0 licensed, starting from version 2014.1.416.
Prior to version 2014.1.416, Kendo UI "Web" was licensed under GPLv3.

A pro version - with a commercial license - is also available, it provides additional widgets (see http://docs.telerik.com/kendo-ui/intro/supporting/list-of-widgets)
To be able to use it, you need to change the ResourceReference with kendo.all.min.js

See also

[howto]-change-resource-references

Sources

  • Java
  • HTML
  • CSS
package com.googlecode.wicket.jquery.ui.samples.kendoui.treeview;

import org.apache.wicket.markup.head.IHeaderResponse;

import com.googlecode.wicket.jquery.core.Options;
import com.googlecode.wicket.jquery.core.resource.StyleSheetPackageHeaderItem;
import com.googlecode.wicket.kendo.ui.KendoUIBehavior;

public class DefaultTreeViewPage extends AbstractTreeViewPage
{
	private static final long serialVersionUID = 1L;

	public DefaultTreeViewPage()
	{
		Options options = new Options();
		options.set("animation", false);
		options.set("select", "function(e) { e.preventDefault(); }");

		this.add(new KendoUIBehavior("#treeview", "kendoTreeView", options));
	}

	// Methods //

	@Override
	public void renderHead(IHeaderResponse response)
	{
		super.renderHead(response);

		response.render(new StyleSheetPackageHeaderItem(DefaultTreeViewPage.class));
	}
}
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<head>
<wicket:head>
	<title>Wicket Kendo UI: treeview behavior</title>
</wicket:head>
</head>
<body>
<wicket:extend>
	<div id="demo-panel">

		<ul id="treeview">
		    <li data-expanded="true">
		        <span class="k-sprite folder"></span>
		        My Web Site
		        <ul>
		            <li data-expanded="true">
		                <span class="k-sprite folder"></span>images
		                <ul>
		                    <li><span class="k-sprite image"></span>logo.png</li>
		                    <li><span class="k-sprite image"></span>body-back.png</li>
		                    <li><span class="k-sprite image"></span>my-photo.jpg</li>
		                </ul>
		            </li>
		            <li data-expanded="true">
		                <span class="k-sprite folder"></span>resources
		                <ul>
		                    <li data-expanded="true">
		                        <span class="k-sprite folder"></span>pdf
		                        <ul>
		                            <li><span class="k-sprite pdf"></span>brochure.pdf</li>
		                            <li><span class="k-sprite pdf"></span>prices.pdf</li>
		                        </ul>
		                    </li>
		                    <li><span class="k-sprite folder"></span>zip</li>
		                </ul>
		            </li>
		            <li><span class="k-sprite html"></span>about.html</li>
		            <li><span class="k-sprite html"></span>contacts.html</li>
		            <li><span class="k-sprite html"></span>index.html</li>
		            <li><span class="k-sprite html"></span>portfolio.html</li>
		        </ul>
		    </li>
		</ul>

	</div>
</wicket:extend>
</body>
</html>
#treeview .k-sprite {
	background-image:
		url("http://demos.telerik.com/kendo-ui/content/web/treeview/coloricons-sprite.png");
}

.rootfolder {
	background-position: 0 0;
}

.folder {
	background-position: 0 -16px;
}

.pdf {
	background-position: 0 -32px;
}

.html {
	background-position: 0 -48px;
}

.image {
	background-position: 0 -64px;
}