Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    treegrid problem

    I can't make it work, always send untitled in the grid
    what's wrong?

    isc.DataSource.create({
    ID: "myCommunityDS",
    dataFormat: "json",
    dataURL: "gridCommunity_data.php",
    showPrompt: true,
    fields:[
    {name:"companyID", type:"integer"},
    {name:"ReportsTo", type:"integer"},
    {name:"Name", type:"text", lenght:100}
    ]
    });
    isc.TreeGrid.create({
    ID: "myCommunityTG",
    width: 500,
    height: 400,
    dataSource: "myCommunityDS",
    nodeIcon:"/images/node.gif",
    folderIcon:"/images/folder.gif",
    showOpenIcons:false,
    showDropIcons:false,
    closedIconSuffix:"",
    autoFetchData: true,
    data: isc.Tree.create({
    modelType: "parent",
    rootValue: "1",
    nameProperty: "Name",
    idField: "companyId",
    parentIdField: "ReportsTo",
    data: myCommunityDS
    })
    });

    and the gridCommunity_data.php result is:

    [{companyId:"4", ReportsTo:"1", Name:"Charles Madigen"},{companyId:"188", ReportsTo:"4", Name:"Rogine Leger"},{companyId:"189", ReportsTo:"1", Name:"Gene Porter"},{companyId:"265", ReportsTo:"189", Name:"Olivier Doucet"},{companyId:"264", ReportsTo:"189", Name:"Cheryl Pearson"}]

    please help, I need to sleep !.
    regards,

    #2
    Your Tree is being ignored. autoFetchData:true is causing it to be immediately replaced with an automatically generated ResultTree.

    Then, because this wipes out your setting for nameField and you have not set titleField in the DataSource, "companyID" is being chosen as the field name to display in the tree.

    Then, you have a case mismatch: companyID is the name of the DataSource field but companyId is what's in the data.

    Comment

    Working...
    X