GXT - 如何将网格过滤器参数添加到请求 URL(获取参数)?
final PagingLoader<PagingLoadResult<ModelData>> loader = new BasePagingLoader<PagingLoadResult<ModelData>>(proxy, reader) {
@Override
protected Object newLoadConfig() {
BasePagingLoadConfig config = new BaseFilterPagingLoadConfig();
return config;
}
};
=
请求网址:http://localhost/index.php?action=getLines&limit=10&sortField=null&offset=0&sortDir=NONE&filters=[com.extjs.gxt.ui.client.data.BaseStringFilterConfig@3abbafc7]
filters=[com.extjs.gxt.ui.client.data.BaseStringFilterConfig@3abbafc7] ???
如何将此行转换为请求网址?
谢谢!
最佳答案
听起来 BaseStringFilterConfig 中缺少 toString 方法,以便按照您的描述使用它。
确保您使用定义了 toString 方法的BaseStringFilterConfig - 为此,您必须手动覆盖它。
创建一个扩展 BaseStringFilterConfig 类并重写 toString() 方法的类。
作为示例,您可以使用 私有(private)静态最终类 BaseStringFilterConfigWithStringRepresentation 扩展 BaseStringFilterConfig {
@Override
public String toString() {
return "[field=" + getField() + "| comparison=" +
getComparison() + " | type=" + getType() + " | value=" +
getValue() + "]";
}
}
请注意不要使用逗号作为分隔符,因为过滤器字段已经作为逗号分隔列表出现。您必须以某种方式在服务器端解析它,然后返回正确的结果。
关于java - GXT - 如何将网格过滤器参数添加到请求 URL(获取参数)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12254440/