org.wicketstuff.datatables.options.Options Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wicketstuff-datatables Show documentation
Show all versions of wicketstuff-datatables Show documentation
DataTables jQuery integration for Wicket
package org.wicketstuff.datatables.options;
import de.agilecoders.wicket.jquery.AbstractConfig;
import de.agilecoders.wicket.jquery.IKey;
import de.agilecoders.wicket.jquery.Key;
import de.agilecoders.wicket.jquery.util.Json;
import org.apache.wicket.markup.head.CssHeaderItem;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.request.resource.CssResourceReference;
import org.apache.wicket.util.lang.Args;
import org.wicketstuff.datatables.Sort;
import org.wicketstuff.datatables.res.DataTablesCssReference;
import java.util.List;
/**
*
*/
public class Options extends AbstractConfig {
/**
* https://datatables.net/examples/basic_init/alt_pagination.html
*/
public enum PagingType {
numbers,
/**
* 'Previous' and 'Next' buttons only
*/
simple,
/**
* 'Previous' and 'Next' buttons, plus page numbers
*/
simple_numbers,
/**
* 'First', 'Previous', 'Next' and 'Last' buttons
*/
full,
/**
* 'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers
*/
full_numbers
}
public enum Style {
dataTables,
bootstrap,
foundation,
jqueryui,
none;
public void renderHead(IHeaderResponse response, String pluginName) {
if (none != this) {
if (!(dataTables == this && "dataTables".equals(pluginName))) {
String name = "css/" + pluginName + "." + name() + ".css";
CssResourceReference cssReference = new CssResourceReference(DataTablesCssReference.class, name);
response.render(CssHeaderItem.forReference(cssReference));
}
}
}
}
/**
* https://datatables.net/examples/basic_init/table_sorting.html
*/
public static final IKey Order = new Key<>("order", null);
/**
* https://datatables.net/examples/basic_init/state_save.html
*/
public static final IKey StateSave = new Key<>("stateSave", false);
/**
* In seconds.
*
* https://datatables.net/examples/basic_init/state_save.html
* https://datatables.net/reference/option/stateDuration
*/
public static final IKey StateDuration = new Key<>("stateDuration", 7200);
/**
* https://datatables.net/examples/basic_init/alt_pagination.html
*/
public static final IKey _PagingType = new Key<>("pagingType", PagingType.simple_numbers);
/**
* https://datatables.net/reference/option/paging
*/
public static final IKey Paging = new Key<>("paging", true);
/**
* https://datatables.net/reference/option/scrollY
* https://datatables.net/examples/basic_init/scroll_y.html
*/
public static final IKey ScrollY = new Key<>("scrollY", null);
/**
* https://datatables.net/reference/option/dom
*/
public static final IKey Dom = new Key<>("dom", "lfrtip");
/**
* https://datatables.net/examples/basic_init/scroll_y.html
* https://datatables.net/reference/option/scrollCollapse
*/
public static final IKey ScrollCollapse = new Key<>("scrollCollapse", false);
/**
* https://datatables.net/examples/basic_init/scroll_x.html
* https://datatables.net/reference/option/scrollX
*/
public static final IKey ScrollX = new Key<>("scrollX", false);
/**
* https://datatables.net/manual/server-side
* https://datatables.net/reference/option/serverSide
* https://datatables.net/extensions/scroller/examples/initialisation/server-side_processing.html
*/
public static final IKey ServerSide = new Key<>("serverSide", false);
public static final IKey Ordering = new Key<>("ordering", true);
public static final IKey Searching = new Key<>("searching", true);
public static final IKey DeferRender = new Key<>("deferRender", false);
public static final IKey Info = new Key<>("info", true);
public static final IKey Processing = new Key<>("processing", false);
public static final IKey Ajax = new Key<>("ajax", null);
/**
* https://datatables.net/reference/option/rowId
*/
public static final IKey RowId = new Key<>("rowId", new Json.RawValue("'DT_RowId'"));
public static final IKey Scroller = new Key<>("scroller", null);
/**
* https://datatables.net/extensions/select/
*/
public static final IKey Select = new Key<>("select", null);
/**
* https://datatables.net/examples/server_side/select_rows.html
* https://datatables.net/reference/option/rowCallback
*/
public static final IKey RowCallback = new Key<>("rowCallback", null);
/**
*
* https://datatables.net/reference/option/deferLoading
*/
public static final IKey DeferLoading = new Key<>("deferLoading", null);
/**
* https://datatables.net/examples/advanced_init/row_callback.html
* https://datatables.net/reference/option/createdRow
*/
public static final IKey CreatedRow = new Key<>("createdRow", null);
/**
* https://datatables.net/manual/data/renderers
*/
public static final IKey Render = new Key<>("render", null);
/**
* https://datatables.net/examples/advanced_init/length_menu.html
* https://datatables.net/reference/option/lengthMenu
*/
public static final IKey
© 2015 - 2025 Weber Informatics LLC | Privacy Policy