I am using igTree with LoadOnDemand is set to true.
I have a WCF REST Service which giving me data to populate in igTree.
Please find the sample code..
$.ajax(
{
type: "GET",
url: "AssessmentProcWCFService.svc/GetAllEntities",
contentType: "application/json; charset=utf-8",
dataType: 'json',
data: '{}',
cache: false,
success: OnGetAllEntitiesSuccess,
error: OnGetAllEntitiesFailure
});
==================================================
function OnGetAllEntitiesSuccess(categoryList) {
$("#APTreeView").igTree({
animationDuration: 0,
dataSourceType: 'json',
dataSource: categoryList.d,
initialExpandDepth: false,
loadOnDemand: true,
dataSourceUrl: "AssessmentProcWCFService.svc/GetAllCategories?EntityID=primaryKey:id",
bindings: {
textKey: 'text',
valueKey: 'id',
primaryKey: 'id',
expanded: 'expanded',
childDataProperty: 'children'
}
=========================================================
Questions:-
1. How could I send the selected node ID to the Service when any node of the tree is expanding?
The way I am sending in the above example it is not working when I am retrieving it in the service “public List<APEntityTree> GetAllCategories()” like
“string entityID = HttpContext.Current.Request.QueryString["EntityID"];”
I am getting entity id as null.
2. How the tree get rendered when any node get expanded if LoadOnDemand is true?
Please help me on this I have spend lot of time in it.
There isn't a context menu internally supported by the tree, however a custom implementation should work just fine!
Thank you for using the Infragistics forums!
Hi,
Can i have context menu on right mouse button click on the selected node?
If yes please provide me with some sample.
Can you please provide us with a sample reproducing the issue.
Thanks!
Here is the response i am getting it correctly.I have two child node what i am getting but the tree is not rendering it.
Response{"d":[{"__type":"APEntityTree:#","children":[],"data":{"__type":"Data:#","FullName":null,"area":0,"color":null,"imageUrl":null,"playcount":null,"risklevel":null},"expanded":false,"id":"e5a53c73-fa01-449b-9609-175699d11534","text":"Assessments"},{"__type":"APEntityTree:#","children":[],"data":{"__type":"Data:#","FullName":null,"area":0,"color":null,"imageUrl":null,"playcount":null,"risklevel":null},"expanded":false,"id":"e5a53c73-fa01-449b-9609-175699d11534","text":"Assessment Procedures"}]}
Hi again,
Could you open the network tab of your browser and monitor the request. Inspect the response body in order to see whether the data is actually returned or some internal error is thrown (500). If the second happens, then most probably you need to set AllowGet to true for the JsonResult that you're returning. Let me know if this is not it.