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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

handling queries with loadOnDemand

Thread ID:





121201 Nov 18,2015 01:28 PM UTC Nov 19,2015 10:33 AM UTC JavaScript 1
Tags: ejTreeView
Sven Grundmann
Asked On November 18, 2015 01:28 PM UTC

dear sir or madam,

in my project i want to place a treeview with loadOnDemand = true like this:

        var dm = ej.DataManager({ url: "/WebServices/wcf/TreeViewODataService.svc" });

        var query = new ej.Query().from("Products");

        var treecontrol = $("#tree");


            showCheckbox: true,

            loadOnDemand: true,

            width: 400,

            height: 500,

            fields: {

                dataSource: dm,

                query: query,

                hasChild: "HasChildren",

                expanded: "Expanded",

                id: "ID",

                parentId: "ParentId",

                text: "Name"


            loadSuccess: function (args) {



            loadError: function (args) {




On first load the underlying OData webservice is called with an empty oData query. When i want to expand a node, the query string is something like "ParentId='...'". The new nodes are added to the tree as I would expect it. When I now want to expand one of the newly added nodes the query String, that is passed to my OData Service looks like: "ParentId=%27...%27%20and%20ParentId..."

As you can imagine, no element in my hierarchy wil fit this condition, as every element has only got exactly one parent id. 

I know can manipulate the query string in my Service function, such that it will return the expected elements, but the treeview won't show them. Instead of showing these child elements the node remains in waiting state. Note, that no Javascript exception is thrown in my browser.

Second question:

As I use a dynamic hierarchy, I do not know in advance, if a node has children or not. If I want to expand a node with no children, the node also remains in waiting state.

Please, can you provide me a solution for these problems? 

Best regards


Saravanan Janakiraman [Syncfusion]
Replied On November 19, 2015 10:33 AM UTC

Hi Sven,

Thanks for contacting Syncfusion support.

We are able to reproduce the reported issue (“The two pids are returned on the second level of data retrieval process”), we have confirmed this as a defect and logged an issue report for this. Please log on to our support website to check for further updates.

Link: https://www.syncfusion.com/account/login

Please let us know if you have further queries.


Saravanan A J


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon