When TreeGrid.setLoadDataOnDemand is set to false, Hilite elements are not applied to child records. Set it to true, and all is fine.
Having found an issue with my TreeGrid code, I stripped down what I was trying to do and implemented it with your sample showcase code. You'll notice the extra Hilite code at the bottom.
Version: SmartGWT 2.5 Pro
Browser: FireFox 3.6
EmployeeXmlDS employeesDS = EmployeeXmlDS.getInstance();
final TreeGrid treeGrid = new TreeGrid();
//Set this to TRUE and hilites work for all records
//Set it to FALSE and hilites work for root records only.
treeGrid.setLoadDataOnDemand(false);
treeGrid.setWidth100();
treeGrid.setHeight100();
treeGrid.setDataSource(employeesDS);
treeGrid.setCanEdit(true);
treeGrid.setNodeIcon("icons/16/person.png");
treeGrid.setFolderIcon("icons/16/person.png");
treeGrid.setAutoFetchData(true);
treeGrid.setCanFreezeFields(true);
treeGrid.setCanReparentNodes(true);
TreeGridField nameField = new TreeGridField("Name", 150);
nameField.setFrozen(true);
TreeGridField jobField = new TreeGridField("Job", 150);
TreeGridField employeeTypeField = new TreeGridField("EmployeeType", 150);
TreeGridField employeeStatusField = new TreeGridField("EmployeeStatus", 150);
TreeGridField salaryField = new TreeGridField("Salary");
TreeGridField genderField = new TreeGridField("Gender");
TreeGridField maritalStatusField = new TreeGridField("MaritalStatus");
treeGrid.setFields(nameField, jobField, employeeTypeField, employeeStatusField,
salaryField, genderField, maritalStatusField);
Hilite h = new Hilite();
h.setFieldName("Gender");
Criterion c = new Criterion("Gender", OperatorId.EQUALS, "male");
h.setBackgroundColor("blue");
h.setCriteria(c);
Hilite[] harray = new Hilite[1];
harray[0] = h;
treeGrid.setHilites(harray);
treeGrid.draw();
The attached treegrid.png shows the result (when opening a parent node).
Is there something I have to do to allow hilites to apply to ALL records?
Thanks!
Having found an issue with my TreeGrid code, I stripped down what I was trying to do and implemented it with your sample showcase code. You'll notice the extra Hilite code at the bottom.
Version: SmartGWT 2.5 Pro
Browser: FireFox 3.6
EmployeeXmlDS employeesDS = EmployeeXmlDS.getInstance();
final TreeGrid treeGrid = new TreeGrid();
//Set this to TRUE and hilites work for all records
//Set it to FALSE and hilites work for root records only.
treeGrid.setLoadDataOnDemand(false);
treeGrid.setWidth100();
treeGrid.setHeight100();
treeGrid.setDataSource(employeesDS);
treeGrid.setCanEdit(true);
treeGrid.setNodeIcon("icons/16/person.png");
treeGrid.setFolderIcon("icons/16/person.png");
treeGrid.setAutoFetchData(true);
treeGrid.setCanFreezeFields(true);
treeGrid.setCanReparentNodes(true);
TreeGridField nameField = new TreeGridField("Name", 150);
nameField.setFrozen(true);
TreeGridField jobField = new TreeGridField("Job", 150);
TreeGridField employeeTypeField = new TreeGridField("EmployeeType", 150);
TreeGridField employeeStatusField = new TreeGridField("EmployeeStatus", 150);
TreeGridField salaryField = new TreeGridField("Salary");
TreeGridField genderField = new TreeGridField("Gender");
TreeGridField maritalStatusField = new TreeGridField("MaritalStatus");
treeGrid.setFields(nameField, jobField, employeeTypeField, employeeStatusField,
salaryField, genderField, maritalStatusField);
Hilite h = new Hilite();
h.setFieldName("Gender");
Criterion c = new Criterion("Gender", OperatorId.EQUALS, "male");
h.setBackgroundColor("blue");
h.setCriteria(c);
Hilite[] harray = new Hilite[1];
harray[0] = h;
treeGrid.setHilites(harray);
treeGrid.draw();
The attached treegrid.png shows the result (when opening a parent node).
Is there something I have to do to allow hilites to apply to ALL records?
Thanks!
Comment