We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ej.treeView databinding with checkboxes


I have some questions about ej.treeView.

The control can't be fully checkboxes when i use datasource with "showCheckbox: true".

I try to combine two examples in the samples\treeview folder (localdatabinding.html, checkbox.html)

But if set, "showCheckbox: true" then checkbox shows only on child nodes not on the parent (like not checkbox.html). I want to see a checkbox on the parent too.

The other thing is that when i click the first child node of the parent node, it's checkbox fully filled (like it is a parent node and it has one or more checked childs) but the other clicked childs looking normal.

Screen caps:

The  code:
                var localData = [
                   { id: 1, name: "Discover Music", hasChild: true, expanded: true, isChecked: true },
                   { id: 2, pid: 1, name: "Hot Singles" },
                   { id: 3, pid: 1, name: "Rising Artists" },
                   { id: 4, pid: 1, name: "Live Music" },
                   { id: 6, pid: 1, name: "Best of 2013 So Far" },
                   { id: 7, name: "Sales and Events", hasChild: true, expanded: true },
                   { id: 8, pid: 7, name: "100 Albums - $5 Each" },
                   { id: 9, pid: 7, name: "Hip-Hop and R&B Sale" },
                   { id: 10, pid: 7, name: "CD Deals" },
                   { id: 11, name: "Categories", hasChild: true },
                   { id: 12, pid: 11, name: "Songs" },
                   { id: 13, pid: 11, name: "Bestselling Albums" },
                   { id: 14, pid: 11, name: "New Releases" },
                   { id: 15, pid: 11, name: "Bestselling Songs" },
                   { id: 16, name: "MP3 Albums", hasChild: true },
                   { id: 17, pid: 16, name: "Rock" },
                   { id: 18, pid: 16, name: "Gospel" },
                   { id: 19, pid: 16, name: "Latin Music" },
                   { id: 20, pid: 16, name: "Jazz" },
                   { id: 21, name: "More in Music", hasChild: true },
                   { id: 22, pid: 21, name: "Music Trade-In" },
                   { id: 23, pid: 21, name: "Redeem a Gift Card" },
                   { id: 24, pid: 21, name: "Band T-Shirts" },
                   { id: 25, pid: 21, name: "Mobile MVC"}];

                    fields: { id: "id", parentId: "pid", text: "name", hasChild: "hasChild", dataSource: localData, expanded: "expanded"},
                    showCheckbox: true



3 Replies

JA John Arokyaraj V Syncfusion Team October 18, 2013 11:12 AM UTC

Hi Ilker,


Thank you using Syncfusion products.


Query: Checkbox not appears in root element on TreeView widget while applying these two properties ‘showCheckbox: true’ and dataSource?


We have analyzed the reported issue with our sample; we are unable to reproduce the issue. Can you please check with the sample attached? If still you face the problem, please revert us by modifying the sample based on your application along with replication procedure. This would be helpful for us to serve you.



Please let us know if you need any further assistance.


John Arokyaraj V


IK ilker kose October 29, 2013 01:29 PM UTC

Hi, thank you very much for help.

When i changed
<ul id="treeView"></ul>
 <div id="treeView"></div>
then it's fixed.

Now there are 2 things for fix, i really tried a lot of things.
First one is, i added images first 3 elements.
The image of parent is after the chechbox.
But the image of childs before the checkbox. Is it true view?

The other one is, my data for binding has fully "isChecked: true" for all elements.
But the second Parent says that some child elements is not checked.
Am i missing something?

Thanks again.
ps. the picture in below and the files in the attachment.


SG Saravanan G Syncfusion Team November 1, 2013 06:42 AM UTC

Hi Ilker,


Thank you for your update.


Query 1:  First one is, i added images first 3 elements, the image of parent is after the chechbox.


Query 2: The other one is, my data for binding has fully "isChecked: true" for all elements.


We are able to reproduce the above issues in TreeView control and we have logged an Issue report on these. The fix for these issues will be include in our upcoming release which will be available in first week of December 2013. So please be patience until the issue has been fixed.


Please let us know if you need any further assistance.



Saravanan G.

Live Chat Icon For mobile
Up arrow icon