Hi,
I would like to achieve to load from server a datasource bound tree grid with rows (parent/child relation) based on a simple criteria composed of 3 field/values and then allow the user to filter the rows on client based on other fields. Is is possible?
I tried the following setup but it didn't work. Here is the code:
When used this version the fetchCustom sends to server no fields in the criteria, altough ServerFilterFields is set with those 3 fields.
If setKeepParentsOnFilter and setServerFilterFields lines are commented out then fetchCustom sends the right criteria to server, but using the Filter Editor triggers a new server call with additional field/value.
I also tried to use on the tree grid:
but didn't work either.
Could you please advise what is wrong with that code?
I used the latest smartgwtpower-3.1p-2013-03-05.
Thanks,
Mihnea
I would like to achieve to load from server a datasource bound tree grid with rows (parent/child relation) based on a simple criteria composed of 3 field/values and then allow the user to filter the rows on client based on other fields. Is is possible?
I tried the following setup but it didn't work. Here is the code:
Code:
public class CustomTreeGrid extends TreeGrid { public CustomTreeGrid() { setDataSource(dataSource); setAutoFetchData(false); setShowFilterEditor(true); setLoadDataOnDemand(false); setKeepParentsOnFilter(true); setServerFilterFields("f1","f2","f3"); setFields(f1,f2,f3,f4,f5,f6);//f1-6 are TreeGridField objects } public void fetchCustom(String v1,String v2,String v3) { Criteria criteria = new Criteria("f1",v1); criteria.addCriteria("f2", v2); criteria.addCriteria("f3", v3); fetchData(criteria); } }
If setKeepParentsOnFilter and setServerFilterFields lines are commented out then fetchCustom sends the right criteria to server, but using the Filter Editor triggers a new server call with additional field/value.
I also tried to use on the tree grid:
Code:
ResultTree dataPropeties = new ResultTree(); dataPropeties.setKeepParentsOnFilter(true); dataPropeties.setServerFilterFields("f1","f2","f3"); setDataProperties(dataPropeties);
Could you please advise what is wrong with that code?
I used the latest smartgwtpower-3.1p-2013-03-05.
Thanks,
Mihnea
Comment