filter TreeGrid

Hi,

Is it possible to filter TreeGrid on the client only? It works for ListGrid when it has all the data on the client but for TreeGrid it seems to me that it always initiate a fetch request to the server even if it got all the data.

Please help.

Please help, anyone?

Client-side Tree filtering is not (yet) a built-in feature, but can be achieved with custom code. Another option is Feature Sponsorship.

knguyen,

I did this way:

Create a Datasource as usual(Foreign Key -> Primary Key), and:

		datasource.setClientOnly(true);
		datasource.setTestData(...);

Create a TreeGrid:

		// Tree Grid
		this.treeGrid = new TreeGrid();
		// ...
		this.treeGrid.setLoadDataOnDemand(false);
		this.treeGrid.setDataSource(dataSource);
		this.treeGrid.setAutoFetchData(true);
		this.treeGrid.setShowFilterEditor(true);
		this.treeGrid.setFilterOnKeypress(true);
		this.treeGrid.setAutoFetchAsFilter(true);
		// ...

Regards,

Clever. That’s true, a client-only DataSource approach will work so long as you don’t need editing. Bear in mind that’s not quite a true tree filtering interaction, because if a child matches the filter, all parents must also match the filter or the child won’t be shown.

Yeah, you are right, need to write a recursive DataSource Filter function for this.

@terciof: did you manage to implement a recursive filter function? I’m faced with the exact same problem right now. I have a client-side only TreeGrid with a client-side datasource.

I’m using SmartGWT 2.1 and GWT 2.0.3.

Thanx,

Thomas

Hi guys I have got 1 working solution for treegrid filteration if u want u can contact me… bhola_only4u@yahoo.com

ok so how to roll our own

Hello,

So roughly how would one roll our own server side filter?

I have the filter, I send it over the wire as a critiera on the name field. But what to do with the parentid?

Could someone post their solution to this problem?

Marc