Simple TreeGrid error

Hi !

For a day I try to do some basic thing based on your example without success. Maybe you can tell me what I’m doing wrong?
I start with your “Load on Demand” example and my code is:

RestDataSource.create({
    ID:"mainMenuData",
    serverType: "json",
    dataURL: "/dataServer.html",
	fields:[
        {name:"menuId",   type:"text", primaryKey: "true" , required:"true" },
        {name:"parentId",  type:"text",  foreignKey:"mainMenuData.menuId", required:"true",  rootValue:"1"  },
       {name:"description",  type:"text" } ]
    });

isc.TreeGrid.create
({ID: "MainMenuTree",
  width: 500,
    height: 400,
    dataSource: "mainMenuData",
    autoFetchData: true,
    nodeIcon:"icons/16/person.png",
    folderIcon:"icons/16/person.png",
    showOpenIcons:false,
    showDropIcons:false,
    closedIconSuffix:""

  });

as you can see - very basic
The response sent by my server is following:

{“response”: {“endRow”: 0, “status”: 0, “totalRows”: 1, “startRow”: 0, “data”: [{“menuId”: “2”, “description”: “test”, “parentId”: “1”}]}}

and the error message is:
_3 has no properties
[Break on this error] if(_4.totalRows!=null)_1.totalRows=_4.totalRows;if(_4.startRow!=null)_1.startRow…

You probably meant dataFormat:“json” rather than serverType:“json” (serverType:“json” is not a valid setting).

Other than that, your code looks fine (we have not actually tried running it). Just be sure your dataURL is returning the JSON only (we notice it says .html).

Keep the Developer Console open and follow the tips in the Debugging topic and you’ll get much better, clearer diagnostic information that what you showed.

Thank you VERY much!
Quick response, right solution (serverType->dataFormat).
Not only your product; your support is also just fantastic. The best one I ever see !

No problem :slight_smile: Thanks for using SmartClient