重要编辑:我在情境中添加了深度级别以更好地反映我的问题。sencha网格列的自定义对象过滤器GXT
我有一个GXT网格与某种类型的一个ListStore Foo
。 Foo
恰好具有一些重要的对象属性,其中包括Bar
类型之一。类型Bar
由两个对象属性组成:fooFoo
类型FooFoo
和barBar
类型Barbar
。这两个可以是null
并具有String
属性description
。
我想使用GXT网格的过滤通过Bar
值的FooFoo
或BarBar
描述过滤Foo
对象记录。
我尝试添加ValueProvider<Foo, String> barDescription();
到FooProperties
,导致:
public String getBarBarDescription() {
return this.getBar().getBarBar().getDescription();
}
有一个简单/便捷的方式:
StringFilter<Foo> barbarFilter = new StringFilter<Foo>(fooProps.barbarDescription());
在这Foo#getBarBarDescription()
执行如下在GXT中实现这种行为?我没有找到它。
我上面描述的实现是我尝试过的实现,但过滤器根本不显示在网格中,没有其他错误消息。
为响应科林的回答到以前的版本我的问题,我已经试过如下:
@Path("bar.barbar.description")
ValueProvider<Foo, String> barbarDescription();
盼望它打电话Foo#getBar().getBarBar().getDescription()
。我怀疑FooFoo和BarBar的可能性为null
可能会导致问题。
按照我的说法,你做对了,没有其他简单的方法。 – sanbhat 2013-05-07 14:06:36