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.
Unfortunately, activation email could not send to your email. Please try again.

handling queries with loadOnDemand

Thread ID:

Created:

Updated:

Platform:

Replies:

121201 Nov 18,2015 08:28 AM Nov 19,2015 05:33 AM JavaScript 1
loading
Tags: ejTreeView
Sven Grundmann
Asked On November 18, 2015 08:28 AM

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");

        $(treecontrol).ejTreeView({

            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) {

                alert();

            },

            loadError: function (args) {

                alert();

            }

        });


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


Sven


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

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.


Regards,

Saravanan A J


CONFIRMATION

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.

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.

;