Using CellTree you have to provide a TreeViewModel. For each node in the 
tree you will create a ListDataProvider that contains the child elements of 
a given node. If you want to filter your tree you have to filter all these 
ListDataProviders. To do so you should create a sub class of 
ListDataProvider and add filter capabilities to it. Maybe something like:

FilterListDataProvider<T> extends ListDataProvider<T> {

  void setFilter(Filter<T> filter) {
    //store it
  }

  public List<T> getOriginalList() {
    return super.getList();
  }

  @Override
  public List<T> getList() {
    List<T> originalData = super.getList();
    if(filter == null) {
       return originalData;
    }
    //filter.apply() should return a new list. Do not modify originalData.
    return filter.apply(originalData);
  }

}

After you have setup the filter you have to call ListDataProvider.refresh() 
to update the CellTree (which hopefully causes getList() to be called). 
Maybe you also have to overwrite other methods of ListDataProvider to make 
the filtered behavior correct.

Also I think CellTree won't open up itself upon refreshing 
ListDataProviders. So you have to do it yourself using 
CellTree.getRootTreeNode().setChildOpen(). Note that setChildOpen() returns 
the child node if its successfully opened so you can walk through the tree 
nodes.

I haven't implemented all of this myself, but I think thats the way I would 
try it.

-- J.


Am Montag, 9. April 2012 08:32:10 UTC+2 schrieb Qrunk:
>
>
> Hi Patrick,
>
> Sorry for late reply, I didnt understood what you meant by filtering of 
> list, as in a tree I might be having so many lists, even nested lists. 
>
> Can you please let me know how would I do filtering , as in any sample 
> code snippet would do the perfect job, can you provide that please.
>
> Thanks
>
>
> On Thursday, 5 April 2012 18:59:01 UTC+5:30, Patrick Tucker wrote:
>>
>> CellTree uses a list...
>>  
>> After your GUI component works, custom header with textbox, you just need 
>> to filter the list??
>>
>> On Wednesday, April 4, 2012 11:44:17 AM UTC-4, Qrunk wrote:
>>
>>> Can some one please put some light on this issue ?? if GXT  has already 
>>> done it cant it be done now in GWT ??
>>>
>>> On Tuesday, 3 April 2012 15:39:20 UTC+5:30, Qrunk wrote:
>>>>
>>>> Hi 
>>>> How to create a filter tree in *GWT* using *CellTre*e, a filter tree 
>>>> is some Tree which has an filter(TextBox) where we can enter values for 
>>>> the 
>>>> leaf node. Once we start entering values we get the tree branches along 
>>>> with leaf nodes reflected on the Tree panel(we have our tree inside a 
>>>> panel). For reference : 
>>>> http://www.sencha.com/examples/explorer.html#filtertree 
>>>>
>>>> We can develop such FilterTree easily in GXT, but we have an 
>>>> requirement to develop it in GWT, not in GXT. Can I have some replies with 
>>>> a short and simple sample code on FilterTree in GWT, or at least any links 
>>>> to refer to. 
>>>
>>>
> On Thursday, 5 April 2012 18:59:01 UTC+5:30, Patrick Tucker wrote:
>>
>> CellTree uses a list...
>>  
>> After your GUI component works, custom header with textbox, you just need 
>> to filter the list??
>>
>> On Wednesday, April 4, 2012 11:44:17 AM UTC-4, Qrunk wrote:
>>
>>> Can some one please put some light on this issue ?? if GXT  has already 
>>> done it cant it be done now in GWT ??
>>>
>>> On Tuesday, 3 April 2012 15:39:20 UTC+5:30, Qrunk wrote:
>>>>
>>>> Hi 
>>>> How to create a filter tree in *GWT* using *CellTre*e, a filter tree 
>>>> is some Tree which has an filter(TextBox) where we can enter values for 
>>>> the 
>>>> leaf node. Once we start entering values we get the tree branches along 
>>>> with leaf nodes reflected on the Tree panel(we have our tree inside a 
>>>> panel). For reference : 
>>>> http://www.sencha.com/examples/explorer.html#filtertree 
>>>>
>>>> We can develop such FilterTree easily in GXT, but we have an 
>>>> requirement to develop it in GWT, not in GXT. Can I have some replies with 
>>>> a short and simple sample code on FilterTree in GWT, or at least any links 
>>>> to refer to. 
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/UaeevD6A1vgJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to