org.got5.tapestry5.jquery.internal.DefaultDataTableModel Maven / Gradle / Ivy
The newest version!
package org.got5.tapestry5.jquery.internal;
import java.util.ArrayList;
import java.util.List;
import org.apache.tapestry5.PropertyConduit;
import org.apache.tapestry5.PropertyOverrides;
import org.apache.tapestry5.Translator;
import org.apache.tapestry5.beaneditor.BeanModel;
import org.apache.tapestry5.grid.ColumnSort;
import org.apache.tapestry5.grid.GridDataSource;
import org.apache.tapestry5.grid.GridSortModel;
import org.apache.tapestry5.grid.SortConstraint;
import org.apache.tapestry5.internal.grid.CollectionGridDataSource;
import org.apache.tapestry5.ioc.internal.util.InternalUtils;
import org.apache.tapestry5.ioc.services.TypeCoercer;
import org.apache.tapestry5.json.JSONArray;
import org.apache.tapestry5.json.JSONObject;
import org.apache.tapestry5.services.Request;
import org.apache.tapestry5.services.TranslatorSource;
import org.got5.tapestry5.jquery.DataTableConstants;
/**
* This is the default implementation of the DataTableModel
*/
public class DefaultDataTableModel implements DataTableModel {
private TypeCoercer typeCoercer;
private Request request;
private GridSortModel sortModel;
private BeanModel model;
private PropertyOverrides overrides;
private TranslatorSource translatorSource;
private JSONObject response = new JSONObject();
public DefaultDataTableModel(TypeCoercer typeCoercer,TranslatorSource translatorSource) {
super();
this.typeCoercer = typeCoercer;
this.translatorSource = translatorSource;
}
/**
* This method will filter all your data by using the search input from your datatable.
*/
public GridDataSource filterData(GridDataSource source){
final List