All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wicketstuff.datatables.DataTables Maven / Gradle / Ivy

There is a newer version: 10.3.0
Show newest version
package org.wicketstuff.datatables;

import static de.agilecoders.wicket.jquery.JQuery.$;

import java.util.List;

import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
import org.apache.wicket.markup.repeater.data.IDataProvider;

/**
 *
 */
public class DataTables extends DataTable {

    private final Options options;

    public DataTables(String id, List> iColumns, IDataProvider dataProvider, long rowsPerPage) {
        super(id, iColumns, dataProvider, rowsPerPage);
        
        setOutputMarkupId(true);
        this.options = new Options();
        
        add(new DataTablesBehavior());
    }

    public Options getOptions() {
        return options;
    }

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

        response.render(OnDomReadyHeaderItem.forScript($(this).chain("dataTable", options).get()));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy