Hi,
I have DataSource similar to EmployeeXmlDS used in TreeGrid showcase examples. The only difference is that I have got more than one foreign key defined prior "ReportsTo" (otherField is a foreign key and it is placed BEFORE tree relationship field reportsToField):
I have noticed that TreeGrid bound to such DataSource takes FIRST foreign key field as the tree relationship which is otherField in my example. Is there a way to somehow point DataSource or TreeGrid which field should be considered as "tree" field ?
Thanks,
MichalG
I have DataSource similar to EmployeeXmlDS used in TreeGrid showcase examples. The only difference is that I have got more than one foreign key defined prior "ReportsTo" (otherField is a foreign key and it is placed BEFORE tree relationship field reportsToField):
Code:
public EmployeeXmlDS(String id) { setID(id); setTitleField("Name"); setRecordXPath("/List/employee"); DataSourceTextField nameField = new DataSourceTextField("Name", "Name", 128); DataSourceIntegerField employeeIdField = new DataSourceIntegerField("EmployeeId", "Employee ID"); employeeIdField.setPrimaryKey(true); employeeIdField.setRequired(true); DataSourceIntegerField otherField = new DataSourceIntegerField("Other", "Other"); otherField.setRequired(true); otherField.setForeignKey("OtherDS.id"); DataSourceIntegerField reportsToField = new DataSourceIntegerField("ReportsTo", "Manager"); reportsToField.setRequired(true); reportsToField.setForeignKey(id + ".EmployeeId"); reportsToField.setRootValue("1"); setFields(nameField, employeeIdField, otherField, reportsToField); setDataURL("ds/test_data/employees.data.xml"); setClientOnly(true); } }
Thanks,
MichalG
Comment