Hello all,
I am trying to find a way to dynamically set the record to leave or folder base on the result from a database before returning it to the client side. Is there a way that I can set this to the data?
Thanks. t.a.
Hello all,
I am trying to find a way to dynamically set the record to leave or folder base on the result from a database before returning it to the client side. Is there a way that I can set this to the data?
Thanks. t.a.
Hello, ta,
Take a look at the documentation for the Tree.isFolder() method. This describes how we determine whether a node is a tree or a leaf.
To mark a record (or node) in a databound-tree as a folder, you can therefore make use of the ‘isFolder’ property, typically by storing this property on the record in the database table.
Does this meet your needs? If not, what behavior would you like to see?
Thanks
Isomorphic Software
I got the data as follow:
<response>
<WorkPlaceList size="38">
<WorkPlace className="Company">
<Id type="serial" isPrimaryKey="true" size="4">101</Id>
<ParentId type="int4" size="4">101</ParentId>
<TypeId type="int4" size="4">80001</TypeId>
<Name type="varchar" size="100">Daisy Corp.</Name>
<isFolder type="varchar" size="20">true</isFolder>
</WorkPlace>
<WorkPlace className="Company">
<Id type="serial" isPrimaryKey="true" size="4">102</Id>
<ParentId type="int4" size="4">102</ParentId>
<TypeId type="int4" size="4">80001</TypeId>
<Name type="varchar" size="100">Tulip Corp.</Name>
<isFolder type="varchar" size="20">true</isFolder>
</WorkPlace>
<WorkPlace className="Department">
<Id type="serial" isPrimaryKey="true" size="4">201</Id>
<ParentId type="int4" size="4">101</ParentId>
<TypeId type="int4" size="4">80002</TypeId>
<Name type="varchar" size="100">Daisy Department</Name>
<isFolder type="varchar" size="20">true</isFolder>
</WorkPlace>
<WorkPlace className="Employee">
<Id type="serial" isPrimaryKey="true" size="4">401</Id>
<ParentId type="int4" size="4">201</ParentId>
<TypeId type="int4" size="4">70001</TypeId>
<Name type="varchar" size="100">Employee 1</Name>
<isFolder type="varchar" size="20">false</isFolder>
</WorkPlace>
<WorkPlace className="Employee">
<Id type="serial" isPrimaryKey="true" size="4">402</Id>
<ParentId type="int4" size="4">201</ParentId>
<TypeId type="int4" size="4">70001</TypeId>
<Name type="varchar" size="100">Employee 2</Name>
<isFolder type="varchar" size="20">false</isFolder>
</WorkPlace>
</WorkPlaceList>
</response>
isFolder set to true/false depend on the type of the data but it still not working.
This set of records looks correct - you need to be explicitly specifying isFolder as either true or false (“true” and “false” are also acceptable).
Have you also included an ‘isFolder’ field definition in the DataSource associated with this data?
That work!
Thank you.